Skip to content

Commit 67b8dd9

Browse files
committed
Fix overshoot stacking
1 parent 73287a9 commit 67b8dd9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Gestures/GestureController.vala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public class Gala.GestureController : Object {
8787
private double velocity;
8888
private int direction_multiplier;
8989

90-
private Clutter.Timeline? timeline;
90+
private SpringTimeline? timeline;
9191

9292
public GestureController (GestureAction action, GestureTarget target) {
9393
Object (action: action, target: target);
@@ -264,7 +264,10 @@ public class Gala.GestureController : Object {
264264
* If you don't want animation but an immediate jump, you should set {@link progress} directly.
265265
*/
266266
public void goto (double to) {
267-
if (progress == to || recognizing) {
267+
var clamped_to = to.clamp ((int) overshoot_lower_clamp, (int) overshoot_upper_clamp);
268+
if (progress == to || recognizing ||
269+
timeline != null && clamped_to == timeline.value_to // Only allow overshoot if there's no ongoing overshoot animation to prevent stacking
270+
) {
268271
return;
269272
}
270273

0 commit comments

Comments
 (0)