Skip to content

fix: clamp clip drag to timeline start (0s) - #59

Open
PriyeshPandey2000 wants to merge 1 commit into
diffusionstudio:mainfrom
PriyeshPandey2000:fix/timeline-negative-drag
Open

fix: clamp clip drag to timeline start (0s)#59
PriyeshPandey2000 wants to merge 1 commit into
diffusionstudio:mainfrom
PriyeshPandey2000:fix/timeline-negative-drag

Conversation

@PriyeshPandey2000

Copy link
Copy Markdown

Root cause

applyClipDrag() (apps/web/src/engine/timeline/drag.ts) computed a clip's new start position from the raw pointer delta with no lower bound, then passed it straight to moveEntityTo(). Dragging a clip past the 0s mark produced a negative start (e.g. -00:02). The sibling trim path already clamps its edge via trimBounds(); the move/drag path was missing the equivalent floor.

Fix

Clamp the computed start to Math.max(0, ...) in applyClipDrag(), matching the trim path's bound.

Fixes #55

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.
@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

@PriyeshPandey2000 is attempting to deploy a commit to the Diffusion Studio Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Timeline tracks can be dragged into negative timestamps (< 0s)

1 participant