From 3dc35a0580e92b3f38e118ff6fa7681855df1a92 Mon Sep 17 00:00:00 2001 From: PriyeshPandey2000 Date: Fri, 4 Sep 2026 15:19:38 +0530 Subject: [PATCH] fix: clamp clip drag to timeline start (0s) applyClipDrag() applied the raw pointer delta to a clip's start position with no lower bound, so dragging past the 0s mark produced negative start times (visible as e.g. -00:02 in the timecode). The sibling trim path already bounded its edge via trimBounds(); the move/drag path was missing the equivalent floor. Clamp the computed start to 0 to match. --- apps/web/src/engine/timeline/drag.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/engine/timeline/drag.ts b/apps/web/src/engine/timeline/drag.ts index e9d2fe2d..45222da3 100644 --- a/apps/web/src/engine/timeline/drag.ts +++ b/apps/web/src/engine/timeline/drag.ts @@ -116,7 +116,7 @@ export function applyClipDrag( const snap = findSnapDelta(world, resolution, offset); if (snap) surface.snapX = framesToPixels(snap.frame, resolution); - moveEntityTo(world, entity, origin.start + offset - (snap?.delta ?? 0)); + moveEntityTo(world, entity, Math.max(0, origin.start + offset - (snap?.delta ?? 0))); } /** Notes where `entity`'s edges are, so a trim can be measured from them. */