Waveform: block overlap when drag-creating a new selection#11969
Merged
niksedk merged 1 commit intoJun 29, 2026
Merged
Conversation
When dragging a brand-new selection in the waveform (to insert a subtitle for that range), the drag extended freely into neighbouring subtitles. Resizing and moving existing lines already clamp against neighbours unless Shift is held or "allow overlap" is enabled, but the new-selection drag did not - so a new line could silently overlap its neighbours, unlike SE4. Clamp the dragged end to the empty gap around the selection's anchor (honouring the minimum gap), and bypass the clamp when Shift is held or Waveform.AllowOverlap is set - matching the resize/move behaviour and SE4's "overlap blocked by default". The rebindable "Insert new selection" shortcut already exists, so no shortcut change is needed.
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.
Part of #11602 (and an SE4-parity fix).
When dragging a new selection in the waveform (to insert a subtitle for that range), the drag extended freely into neighbouring subtitles. Resize/move already clamp against neighbours unless Shift is held or "allow overlap" is enabled, but the new-selection drag did not, so a new line could silently overlap, unlike SE4.
Clamp the dragged end to the empty gap around the selection's anchor (honouring the minimum gap); Shift or
Waveform.AllowOverlapbypasses it. The rebindable "Insert new selection" shortcut already exists, so no shortcut change is needed.