False magnets when closing a gap#1876
Closed
Proggerdogger wants to merge 1 commit into
Closed
Conversation
When dragging a clip to join with another clip it feels like the join fails for no reason. I made it so that instead of stopping part way through joining to the next clip (this was due to hitting a magnet that really shouldn't be present), the join completes, whilst also keeping snapping to playhead working and joining to clips in other sections (e.g. V1 can still snap to V2 clips). I will note that if the playhead and the edge of a clip are nearby, snapping now preferences the edge of the clip which is probably fine but tell me if it creates issues. ## Reproduce 1. Same track: two clips with a 2-frame blank between them. 2. Magnet/snap on. Set zoom so about 1 frame ≈ SNAP (roughly 10 px per frame / scaleFactor ≈ 10). 3. Optionally put the playhead in the gap (makes the bug clearer). 4. Drag the right clip left to close the gap. Before: the clip sticks about halfway across the gap (~0.016s on a ~0.033s gap) or snaps to the blank/playhead instead of the real join. After: the clip joins the left clip’s edge in one magnet action. Still works: snap to playhead when not closing a same-track gap; V1↔V2 cross-track snap when home isn’t mid-join. Co-authored-by: Cursor <cursoragent@cursor.com>
Closed
Member
|
I’m not going to accept all these changes for something so minor especially after the regression. Just move the playhead out of the way. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two changes, first 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
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).
Second, when dragging a clip to join with another clip it feels like the join fails for no reason. I made it so that instead of stopping part way through joining to the next clip (this was due to hitting a magnet that really shouldn't be present), the join completes, whilst also keeping snapping to playhead working and joining to clips in other sections (e.g. V1 can still snap to V2 clips). I will note that if the playhead and the edge of a clip are nearby, snapping now preferences the edge of the clip which is probably fine but tell me if it creates issues.
Reproduce
Before: the clip sticks about halfway across the gap (~0.016s on a ~0.033s gap) or snaps to the blank/playhead instead of the real join.
After: the clip joins the left clip’s edge in one magnet action.
Still works: snap to playhead when not closing a same-track gap; V1↔V2 cross-track snap when home isn’t mid-join.
Change 2 partially relies on change 1, so I am bundling these together.
The build-shotcut-linux failure is not from this change. CI clones mltframework/shotcut and runs git checkout origin/, but the branch only exists on my fork, so checkout fails before compiling.