Skip to content

Fix magnet snap leaving a gap at low timeline zoom - #1869

Merged
ddennedy merged 1 commit into
mltframework:masterfrom
Proggerdogger:fix/magnet-snap-low-zoom
Jul 19, 2026
Merged

Fix magnet snap leaving a gap at low timeline zoom#1869
ddennedy merged 1 commit into
mltframework:masterfrom
Proggerdogger:fix/magnet-snap-low-zoom

Conversation

@Proggerdogger

@Proggerdogger Proggerdogger commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

At low timeline zoom, magnet snap can adjust a clip by less than one pixel while changing its frame. The drop path only committed moves when the pixel delta was at least 1, so a one-frame gap could remain after an apparent snap.

This snaps neighboring clip edges in frame space and commits the drop when the rounded frame changes.

Test plan

  • Zoom timeline out (around scaleFactor 0.2), magnet on, close a one-frame gap between neighboring clips on the same track; after drop they are frame-exact contiguous (no blank).
  • Magnet off: existing non-snap drag/drop behavior unchanged.
  • Playhead/marker snaps still work.

@ddennedy

Copy link
Copy Markdown
Member

Thank you. I reproduced the bug, and this fixes it.

@ddennedy ddennedy added this to the 26.7 milestone Jul 19, 2026
@ddennedy
ddennedy merged commit 4e917b6 into mltframework:master Jul 19, 2026
@Proggerdogger
Proggerdogger deleted the fix/magnet-snap-low-zoom branch July 19, 2026 04:08
@Proggerdogger

Copy link
Copy Markdown
Contributor Author

Happy to help :)

@ddennedy

Copy link
Copy Markdown
Member

I am sorry to report that I have reverted this because it caused a much worse regression: at the default zoom level (and around it) clicking a clip to select it creates a 2-frame transition right of the clip and shifts all clips on the track following the transition increasing the track (sometimes total) duration by 2 frames. Zoomed out a few steps from default, the damage can be difficult to see.

ddennedy added a commit that referenced this pull request Jul 24, 2026
@Proggerdogger

Copy link
Copy Markdown
Contributor Author

No worries thanks for telling me.

@Proggerdogger

Copy link
Copy Markdown
Contributor Author

Problem is fixed here- #1874

Also, it doesn't pass all checks, but that's just because of the github branch I was using, there's no problems with the code.

@ddennedy ddennedy mentioned this pull request Jul 27, 2026
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.

2 participants