From 67f73f1e0e744939f15c9a15a94fa8b04d2e14b7 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 15 Jun 2015 11:15:25 -0700 Subject: [PATCH] consider the scrolling speed during scrolling --- containments/homescreen/package/contents/ui/main.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/containments/homescreen/package/contents/ui/main.qml b/containments/homescreen/package/contents/ui/main.qml index 51e8e388..5f85553f 100644 --- a/containments/homescreen/package/contents/ui/main.qml +++ b/containments/homescreen/package/contents/ui/main.qml @@ -390,8 +390,10 @@ MouseEventListener { } } onDraggingVerticallyChanged: { + //(1000/scrollAnim.duration) is the length scrolled at the current speed in the duration of the animation + if (!draggingVertically && contentY < -headerItem.height + root.height) { - scrollAnim.to = Math.round(contentY/root.height) * root.height + scrollAnim.to = Math.round((contentY + (verticalVelocity / (1000/scrollAnim.duration))) / root.height) * root.height scrollAnim.running = true; } }