Commit c34fbd19 authored by Bernhard Liebl's avatar Bernhard Liebl Committed by Alvin Wong

Fix zoom gesture focal point

Currently, the pinch zoom gesture zooms into a wrong focus point (it
uses the screen position instead of the widget local position). This
fixes it to actually zoom into the point your touch position is located
at.

Differential Revision: https://phabricator.kde.org/D8167
parent 6ed65717
......@@ -75,7 +75,7 @@ QPointF KisZoomAction::Private::centerPoint(QTouchEvent* event)
Q_FOREACH (QTouchEvent::TouchPoint point, event->touchPoints()) {
if (point.state() != Qt::TouchPointReleased) {
result += point.screenPos();
result += point.pos();
count++;
}
}
......@@ -209,7 +209,7 @@ void KisZoomAction::inputEvent( QEvent* event )
if (point.state() != Qt::TouchPointReleased) {
count++;
dist += (point.screenPos() - center).manhattanLength();
dist += (point.pos() - center).manhattanLength();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment