[problem] If the animation duration is 0, we still return the current scroll position. This is
wrong as in the next frame, we will be at the requested position.
[cause] N/A
[solution] If we do not kick off an animation, then we should check whether the duration was 0.
If it was, we should return the target-position instead.
Change-Id: I3e1a96b3de7ca2685a16f6dd6b8ce5aebc1c78af
Signed-off-by: Adeel Kazmi <adeel.kazmi@samsung.com>
// if not animating, then this pan has completed right now.
Self().SetProperty(mPropertyScrolling, false);
mScrolling = false;
// if not animating, then this pan has completed right now.
Self().SetProperty(mPropertyScrolling, false);
mScrolling = false;
- DALI_LOG_SCROLL_STATE("[0x%X] mScrollCompletedSignalV2 2 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
+
+ // If we have no duration, then in the next update frame, we will be at the position specified as we just set.
+ // In this scenario, we cannot return the currentScrollPosition as this is out-of-date and should instead return the requested final position
+ Vector3 completedPosition( currentScrollPosition );
+ if( duration <= Math::MACHINE_EPSILON_10 )
+ {
+ completedPosition = position;
+ }
+
+ DALI_LOG_SCROLL_STATE("[0x%X] mScrollCompletedSignalV2 2 [%.2f, %.2f]", this, completedPosition.x, completedPosition.y);
SetScrollUpdateNotification(false);
SetScrollUpdateNotification(false);
- mScrollCompletedSignalV2.Emit( currentScrollPosition );
+ mScrollCompletedSignalV2.Emit( completedPosition );