aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-06-01 13:02:44 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2021-06-02 10:18:03 +0200
commit19b6f9591257b3a07bf1479bcc2d676e57506447 (patch)
treea726a3dec259d50d851d6d9de2d739ce78ccd6b8 /src/quick/handlers
parenta4fa74d3e7581cb5c6bb82223ee17257f66fa41d (diff)
Update sceneGrabPosition in MultiPointHandler's points, on grab
We seem to have gotten by without this somehow; but the debug output in QQuickPinchHandler::handlePointerEventImpl() made it clear that it wasn't being done: it would always say the points moved from 0,0 to their present locations. Change-Id: If611adea6ecf0c056ae7d9b34ca86a7530cfc144 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/handlers')
-rw-r--r--src/quick/handlers/qquickmultipointhandler.cpp7
-rw-r--r--src/quick/handlers/qquickpinchhandler.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickmultipointhandler.cpp b/src/quick/handlers/qquickmultipointhandler.cpp
index 55a87276fb..85040a1a12 100644
--- a/src/quick/handlers/qquickmultipointhandler.cpp
+++ b/src/quick/handlers/qquickmultipointhandler.cpp
@@ -158,6 +158,13 @@ void QQuickMultiPointHandler::onGrabChanged(QQuickPointerHandler *grabber, QPoin
return;
switch (transition) {
case QPointingDevice::GrabExclusive:
+ for (auto &pt : d->currentPoints)
+ if (pt.id() == point.id()) {
+ pt.m_sceneGrabPosition = point.scenePosition();
+ break;
+ }
+ QQuickPointerHandler::onGrabChanged(grabber, transition, event, point);
+ break;
case QPointingDevice::GrabPassive:
case QPointingDevice::UngrabPassive:
case QPointingDevice::UngrabExclusive:
diff --git a/src/quick/handlers/qquickpinchhandler.cpp b/src/quick/handlers/qquickpinchhandler.cpp
index fffcc2f848..403af14ec8 100644
--- a/src/quick/handlers/qquickpinchhandler.cpp
+++ b/src/quick/handlers/qquickpinchhandler.cpp
@@ -248,11 +248,11 @@ void QQuickPinchHandler::onActiveChanged()
void QQuickPinchHandler::handlePointerEventImpl(QPointerEvent *event)
{
+ QQuickMultiPointHandler::handlePointerEventImpl(event);
if (Q_UNLIKELY(lcPinchHandler().isDebugEnabled())) {
for (const QQuickHandlerPoint &p : currentPoints())
qCDebug(lcPinchHandler) << Qt::hex << p.id() << p.sceneGrabPosition() << "->" << p.scenePosition();
}
- QQuickMultiPointHandler::handlePointerEventImpl(event);
qreal dist = 0;
#if QT_CONFIG(gestures)