aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickflickable_p_p.h
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2012-06-13 11:17:44 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-13 09:07:03 +0200
commit6a1f3c1b355ae1834ed6b6515a575f46f6f58897 (patch)
treece02ee14ff0513b716b9de9fec3f2b712310a530 /src/quick/items/qquickflickable_p_p.h
parent86cbb55522f9a4ca76854be860a8131f006553a8 (diff)
Update Flickable velocity/overbound for each axis independently
We were attempting to update velocities/overbound correction for both axes even if only one of them had changed, leading to inaccurate values for one of the axes. Also removes a bunch of code duplication. Change-Id: I6a50b908992c976889373f541bdd1abad462e247 Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src/quick/items/qquickflickable_p_p.h')
-rw-r--r--src/quick/items/qquickflickable_p_p.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/quick/items/qquickflickable_p_p.h b/src/quick/items/qquickflickable_p_p.h
index 64335c8240..e0fa526d15 100644
--- a/src/quick/items/qquickflickable_p_p.h
+++ b/src/quick/items/qquickflickable_p_p.h
@@ -103,7 +103,7 @@ public:
, transitionToBounds(0)
, viewSize(-1), startMargin(0), endMargin(0)
, transitionTo(0)
- , continuousFlickVelocity(0)
+ , continuousFlickVelocity(0), vTime(0)
, smoothVelocity(fp), atEnd(false), atBeginning(true)
, transitionToSet(false)
, fixingUp(false), inOvershoot(false), moving(false), flicking(false)
@@ -138,6 +138,7 @@ public:
QQuickFlickableReboundTransition *transitionToBounds;
qreal viewSize;
qreal pressPos;
+ qreal lastPos;
qreal dragStartOffset;
qreal dragMinBound;
qreal dragMaxBound;
@@ -147,6 +148,8 @@ public:
qreal endMargin;
qreal transitionTo;
qreal continuousFlickVelocity;
+ QElapsedTimer velocityTime;
+ int vTime;
QQuickFlickablePrivate::Velocity smoothVelocity;
QPODVector<qreal,10> velocityBuffer;
bool atEnd : 1;
@@ -215,8 +218,6 @@ public:
QPointF pressPos;
qreal deceleration;
qreal maxVelocity;
- QElapsedTimer velocityTime;
- QPointF lastFlickablePosition;
qreal reportedVelocitySmoothing;
QMouseEvent *delayedPressEvent;
QQuickItem *delayedPressTarget;
@@ -239,6 +240,9 @@ public:
QQuickFlickable::BoundsBehavior boundsBehavior;
QQuickTransition *rebound;
+ void viewportAxisMoved(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
+ QQuickTimeLineCallback::Callback fixupCallback);
+
void handleMousePressEvent(QMouseEvent *);
void handleMouseMoveEvent(QMouseEvent *);
void handleMouseReleaseEvent(QMouseEvent *);