[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
Albert Astals Cid
aacid at kde.org
Tue Feb 1 01:41:18 CET 2011
A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure:
> >> Ok, I'm here.
> >> It can happen in 2 cases:
> >> 1) Mouse is moved by more than (screen height)/2 vetically between
> >> event loops. I did that with my thinkpoint and it drags not as
> >> excepted if I move cursor fast.
> >
> > Hmm, this is unfortunate we really never though that could be possible,
> > are you really able to reproduce this easily?
>
> Yes i do. If I press my trackpoint firm enought, it happens.
> I think, you can repdroduce it with mouse, if make high enought
> sensitivity.
>
> >> 2) Cursor had wrapped somewhere in other place of code. If it wraps
> >> here, it will do d->mouseGrabPos = mousePos; anyway. As I can see, it
> >> can also wrap while zooming, but it can it happen in the same time it
> >> is draggin?
> >
> > Yes, just drag drag the mouse to the bottom of the screen and continue
> > dragging and see what happens.
>
> I know :). Look at your code:
>
> if ( mousePos.y() <= mouseContainer.top() + 4 &&
> verticalScrollBar()->value() <
> verticalScrollBar()->maximum() - 10 )
> {
> mousePos.setY( mouseContainer.bottom() - 5 );
> QCursor::setPos( mousePos );
> }
> // wrap mouse from bottom to top
> else if ( mousePos.y() >= mouseContainer.bottom() - 4
> && verticalScrollBar()->value() > 10 )
> {
> mousePos.setY( mouseContainer.top() + 5 );
> QCursor::setPos( mousePos );
> }
> // remember last position
> d->mouseGrabPos = mousePos;
>
> It remembers new mouse position anyways. Ever if it wrapped,
> mouseGrabPos corresponds to it. That's why there is no need to check
> if it wrapped last time.
Yes, it does remember the position, so let's see what will happen on the next
mouse move. The new position (mousePos) will be (0,0) and the old
(mouseGrabPos) will be (800, 0) so when you calculate the absolute difference
(absDelta) it will be 800 pixels, right?
>
> Now you understand me?
Not really.
Albert
> _______________________________________________
> Okular-devel mailing list
> Okular-devel at kde.org
> https://mail.kde.org/mailman/listinfo/okular-devel
More information about the Okular-devel
mailing list