aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickpinchhandler_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-06-22 16:37:32 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-06-27 15:31:07 +0000
commitb4d31c9ff5f0c5821ea127c663532d9fc2cae43e (patch)
treee8cbf769123e2c59a3d42fd4d9f1ae67b722a15e /src/quick/handlers/qquickpinchhandler_p.h
parenta1adcf34f8784d05467cf3598064a3e83842fdc0 (diff)
PinchHandler: rename scale to activeScale; scale means target scale
If you want to set target: null and then bind scale to some sort of rendering scale property directly, it's a lot less trouble if the scale property does not keep changing back to 1.0 every time a gesture begins. Added an activeScale property to represent that value, the one that the scale property had before. Task-number: QTBUG-68941 Change-Id: Idcb6735d915a523afe1a948609080af7a83f82ad Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickpinchhandler_p.h')
-rw-r--r--src/quick/handlers/qquickpinchhandler_p.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickpinchhandler_p.h b/src/quick/handlers/qquickpinchhandler_p.h
index c2eedeb9e0..0d0630d2a9 100644
--- a/src/quick/handlers/qquickpinchhandler_p.h
+++ b/src/quick/handlers/qquickpinchhandler_p.h
@@ -67,6 +67,7 @@ class Q_AUTOTEST_EXPORT QQuickPinchHandler : public QQuickMultiPointHandler
Q_PROPERTY(qreal maximumRotation READ maximumRotation WRITE setMaximumRotation NOTIFY maximumRotationChanged)
Q_PROPERTY(PinchOrigin pinchOrigin READ pinchOrigin WRITE setPinchOrigin NOTIFY pinchOriginChanged)
Q_PROPERTY(qreal scale READ scale NOTIFY updated)
+ Q_PROPERTY(qreal activeScale READ activeScale NOTIFY updated)
Q_PROPERTY(qreal rotation READ rotation NOTIFY updated)
Q_PROPERTY(QVector2D translation READ translation NOTIFY updated)
Q_PROPERTY(qreal minimumX READ minimumX WRITE setMinimumX NOTIFY minimumXChanged)
@@ -99,7 +100,8 @@ public:
void setPinchOrigin(PinchOrigin pinchOrigin);
QVector2D translation() const { return m_activeTranslation; }
- qreal scale() const { return m_activeScale; }
+ qreal scale() const { return m_accumulatedScale; }
+ qreal activeScale() const { return m_activeScale; }
qreal rotation() const { return m_activeRotation; }
qreal minimumX() const { return m_minimumX; }
void setMinimumX(qreal minX);
@@ -130,6 +132,7 @@ protected:
private:
// properties
qreal m_activeScale;
+ qreal m_accumulatedScale;
qreal m_activeRotation;
QVector2D m_activeTranslation;