Skip to content

Commit 4d3f353

Browse files
committed
fix active drag
1 parent 4e5f1d1 commit 4d3f353

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/editor/panel/sprites.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,12 @@ fn handleInput(self: *Sprites, file: anytype, mode: ScrollMode, count: usize, px
799799
// mouse/trackpad path below so it can't change that proven behavior.
800800
if (self.drag_active) self.fling.sampleTimed(frame_dx);
801801
if (released_moved) {
802+
// A finger flick usually delivers its last `touchmove` and `touchend`
803+
// on the same frame, which leaves `drag_active` set. Clear it (after
804+
// sampling that final move) so draw()'s `drag_active` branch doesn't
805+
// immediately cancel the coast we're about to start — that race was
806+
// eating the momentum on ~half of all flicks.
807+
self.drag_active = false;
802808
if (!self.fling.releaseWindowed(sprite_fling_touch, sprite_fling_touch_window_s)) {
803809
const snapped: i64 = @intFromFloat(@round(self.scroll_pos));
804810
self.goal = @floatFromInt(snapped);

0 commit comments

Comments
 (0)