aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2012-03-11 17:45:17 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2012-03-11 22:48:51 (GMT)
commite8d1d9709713e804c4ce26215b06cd85c505aca5 (patch)
tree4634dc4f70b37a9c4d4017d99dd03c5534d1c435
parent9bcca662564280f98263d49a6c2169248c992eb1 (diff)
zoom untracked towards cursor
-rw-r--r--kwin/effects/zoom/zoom.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/kwin/effects/zoom/zoom.cpp b/kwin/effects/zoom/zoom.cpp
index 4131399..dd8c48d 100644
--- a/kwin/effects/zoom/zoom.cpp
+++ b/kwin/effects/zoom/zoom.cpp
@@ -268,9 +268,11 @@ void ZoomEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data)
prevPoint = cursorPoint;
break;
case MouseTrackingCentred:
- data.xTranslate = qMin(0, qMax(int(displayWidth() - displayWidth() * zoom), int(displayWidth() / 2 - cursorPoint.x() * zoom)));
- data.yTranslate = qMin(0, qMax(int(displayHeight() - displayHeight() * zoom), int(displayHeight() / 2 - cursorPoint.y() * zoom)));
prevPoint = cursorPoint;
+ // fall through
+ case MouseTrackingDisabled:
+ data.xTranslate = qMin(0, qMax(int(displayWidth() - displayWidth() * zoom), int(displayWidth() / 2 - prevPoint.x() * zoom)));
+ data.yTranslate = qMin(0, qMax(int(displayHeight() - displayHeight() * zoom), int(displayHeight() / 2 - prevPoint.y() * zoom)));
break;
case MouseTrackingPush:
if (timeline.state() != QTimeLine::Running) {
@@ -293,8 +295,6 @@ void ZoomEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data)
timeline.start();
}
}
- // fall through
- case MouseTrackingDisabled:
data.xTranslate = - int(prevPoint.x() * (zoom - 1.0));
data.yTranslate = - int(prevPoint.y() * (zoom - 1.0));
break;
@@ -381,6 +381,8 @@ void ZoomEffect::zoomIn()
polling = true;
effects->startMousePolling();
}
+ if (mouseTracking == MouseTrackingDisabled)
+ prevPoint = QCursor::pos();
effects->addRepaintFull();
}
@@ -394,6 +396,8 @@ void ZoomEffect::zoomOut()
effects->stopMousePolling();
}
}
+ if (mouseTracking == MouseTrackingDisabled)
+ prevPoint = QCursor::pos();
effects->addRepaintFull();
}