mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-29 04:34:01 +00:00
forwardport aacid * r1156334 okular/branches/KDE/4.5/kdegraphics/okular/ui/pageview.cpp:
Fix mouse scrolling when wrapping sometimes sending you where you did not want Patch by Mathieu Lornac svn path=/trunk/KDE/kdegraphics/okular/; revision=1156337
This commit is contained in:
parent
d0b9699732
commit
47801bc4ab
|
@ -1507,7 +1507,17 @@ void PageView::mouseMoveEvent( QMouseEvent * e )
|
|||
QPoint delta = d->mouseGrabPos - mousePos;
|
||||
|
||||
// wrap mouse from top to bottom
|
||||
QRect mouseContainer = KGlobalSettings::desktopGeometry( this );
|
||||
const QRect mouseContainer = KGlobalSettings::desktopGeometry( this );
|
||||
// If the delta is huge it probably means we just wrapped in that direction
|
||||
const QPoint absDelta(abs(delta.x()), abs(delta.y()));
|
||||
if ( absDelta.y() > mouseContainer.height() / 2 )
|
||||
{
|
||||
delta.setY(mouseContainer.height() - absDelta.y());
|
||||
}
|
||||
if ( absDelta.x() > mouseContainer.width() / 2 )
|
||||
{
|
||||
delta.setX(mouseContainer.width() - absDelta.x());
|
||||
}
|
||||
if ( mousePos.y() <= mouseContainer.top() + 4 &&
|
||||
verticalScrollBar()->value() < verticalScrollBar()->maximum() - 10 )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue