diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2018-07-20 15:30:09 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-07-23 10:51:17 +0000 |
commit | a5f1581653bf39938f052eb0138ba0e834266b0c (patch) | |
tree | 5e47338748d1552f50276c44d322d5bcdc5c5700 /src/quick/handlers/qquickhandlerpoint_p.h | |
parent | 8048eed4142e1566bff8e4ca4bfd48c7a8adb8c8 (diff) |
Make sure pressPosition and scenePressPosition are correctly initialized
The problem was that QQuickMultiPointHandler::m_currentPoints were only
initialized when the candidate points matched the min and max number of
points.
So if we wanted to do a two-finger pinch it would only initialize them
when *both* fingers were pressed. Due to the checking of point->state() in
QQuickHandlerPoint::reset(const QQuickEventPoint *point) it meant that it
would only initialize the press position correctly for the *last* pressed
point. This was because the first pressed point would at the point when
reset() was called have a point->state() == QQuickEventPoint::Updated, so
it would not initialize the pressPosition nor the scenePressPosition.
Luckilly we can get the scenePressPosition from the QQuickEventPoint, but
the pressPosition we have to explicitly localize.
Change-Id: I493c736814cfbc265ec33e8a72fc4283edbbdc43
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickhandlerpoint_p.h')
-rw-r--r-- | src/quick/handlers/qquickhandlerpoint_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickhandlerpoint_p.h b/src/quick/handlers/qquickhandlerpoint_p.h index 946b9aac0b..200d5bc825 100644 --- a/src/quick/handlers/qquickhandlerpoint_p.h +++ b/src/quick/handlers/qquickhandlerpoint_p.h @@ -90,6 +90,7 @@ public: qreal pressure() const { return m_pressure; } QSizeF ellipseDiameters() const { return m_ellipseDiameters; } QPointingDeviceUniqueId uniqueId() const { return m_uniqueId; } + void localize(QQuickItem *item); void reset(); void reset(const QQuickEventPoint *point); |