Commit a17879cc authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko
Browse files

swipe-tracker: Don't animate when the distance is 0



Usually it makes sense to restrict the minimum animation duration. However,
if the progress already matches the end progress, it just causes a delay,
so skip it completely.
Signed-off-by: Alexander Mikhaylenko's avatarAlexander Mikhaylenko <alexm@gnome.org>
parent ff9a062b
Pipeline #50300 passed with stages
in 8 minutes and 39 seconds
......@@ -260,7 +260,8 @@ gesture_end (HdySwipeTracker *self)
velocity = self->velocity;
duration = ABS ((self->progress - end_progress) / velocity * DURATION_MULTIPLIER);
duration = CLAMP (duration, MIN_ANIMATION_DURATION, MAX_ANIMATION_DURATION);
if (self->progress != end_progress)
duration = CLAMP (duration, MIN_ANIMATION_DURATION, MAX_ANIMATION_DURATION);
hdy_swipeable_end_swipe (self->swipeable, duration, end_progress);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment