X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fscroll-view%2Fscroll-view-impl.cpp;h=b11b64c72ed79015f40aeb7b98cbb10755b8a4d0;hp=395a3cb8771adfa766ce41c4323a512b327387e8;hb=c80891229bdd801ce5cbc02d68453b4aa7b59397;hpb=e806deab722ba89ad42f4704561503b11d02e6e1;ds=sidebyside diff --git a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp index 395a3cb..b11b64c 100644 --- a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp +++ b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp @@ -1357,6 +1357,8 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity) const float orthoAngleRange = FLICK_ORTHO_ANGLE_RANGE * M_PI / 180.0f; const float flickSpeedThreshold2 = FLICK_SPEED_THRESHOLD*FLICK_SPEED_THRESHOLD; + Vector3 positionSnap = mScrollPostPosition; + // Flick logic X Axis if(mRulerX->IsEnabled()) @@ -1368,10 +1370,18 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity) if((angle >= -orthoAngleRange) && (angle < orthoAngleRange)) // Swiping East { biasX = 0.0f, horizontal = Left; + + // This guards against an error where no movement occurs, due to the flick finishing + // before the update-thread has advanced mScrollPostPosition past the the previous snap point. + positionSnap.x += 1.0f; } else if((angle >= M_PI-orthoAngleRange) || (angle < -M_PI+orthoAngleRange)) // Swiping West { biasX = 1.0f, horizontal = Right; + + // This guards against an error where no movement occurs, due to the flick finishing + // before the update-thread has advanced mScrollPostPosition past the the previous snap point. + positionSnap.x -= 1.0f; } } } @@ -1406,8 +1416,7 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity) alphaFunction = mFlickAlphaFunction; } - // Position Snap //////////////////////////////////////////////////////////// - Vector3 positionSnap = mScrollPostPosition; + // Calculate next positionSnap //////////////////////////////////////////////////////////// if(mActorAutoSnapEnabled) {