Skip to content

Frame accurate snap#1875

Closed
Proggerdogger wants to merge 1 commit into
mltframework:masterfrom
Proggerdogger:fix/frame-accurate-snap
Closed

Frame accurate snap#1875
Proggerdogger wants to merge 1 commit into
mltframework:masterfrom
Proggerdogger:fix/frame-accurate-snap

Conversation

@Proggerdogger

Copy link
Copy Markdown
Contributor

On my quest to fix shotcut bugs I noticed that often snapping would not snap to the edge of a clip but slightly inside of it. I fixed this by rounding snap targets to whole frames (as every clip is a certain number of whole frames you never want to snap onto a decimal place).

Reproduce

  1. New project, magnet/snap on.
  2. Put two clips on the same track with a 1-frame gap (or a project where a tiny blank sits between them).
  3. Zoom the timeline all the way out (very small scale / minimum zoom).
  4. Drag the right clip left until it snaps to the left clip.
  5. Zoom all the way in at the join.

Before: the join is 1 frame short or overlapped, or a transition appears on drop.
After: the clips abut on the same frame (no gap, no 1-frame overlap).

Made with Cursor

On my quest to fix shotcut bugs I noticed that often snapping would not snap to the edge of a clip but slightly inside of it. I fixed this by rounding snap targets to whole frames (as every clip is a certain number of whole frames you never want to snap onto a decimal place).

## Reproduce

1. New project, magnet/snap on.
2. Put two clips on the same track with a 1-frame gap (or a project where a tiny blank sits between them).
3. Zoom the timeline all the way out (very small scale / minimum zoom).
4. Drag the right clip left until it snaps to the left clip.
5. Zoom all the way in at the join.

Before: the join is 1 frame short or overlapped, or a transition appears on drop.
After: the clips abut on the same frame (no gap, no 1-frame overlap).
Co-authored-by: Cursor <cursoragent@cursor.com>
@Proggerdogger

Copy link
Copy Markdown
Contributor Author

Superseded by #1876 (false magnets PR already includes frame-accurate snap). Closing this duplicate Track.js change to avoid merge conflicts.

@Proggerdogger
Proggerdogger deleted the fix/frame-accurate-snap branch July 24, 2026 12:48
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.

1 participant