editor_ops: paste automation at leftmost selected point, not at timel…#1080
Open
pyrotek45 wants to merge 1 commit intoArdour:masterfrom
Open
editor_ops: paste automation at leftmost selected point, not at timel…#1080pyrotek45 wants to merge 1 commit intoArdour:masterfrom
pyrotek45 wants to merge 1 commit intoArdour:masterfrom
Conversation
…ine origin When automation points are selected and copied (Ctrl+C / Ctrl+V or Ctrl+D), the pasted automation was placed far to the right of the paste cursor -- as if the entire automation lane from the start of the song was being copied rather than just the selected nodes. Root cause: cut_copy_points() tracks the earliest selected point in order to normalise the copy buffer to zero-relative offsets before storing it. It initialised 'earliest' from the earliest_time parameter, which callers pass as timepos_t(AudioTime) == 0 samples. Since 0 is always <= any real event position on the timeline, std::min() always kept 0 as 'earliest'. shift_earlier(0) was then a no-op, leaving every event in the copy buffer at its raw model-space position (e.g. 30 seconds into the song). On paste, paste_one() adds model_pos (the paste cursor position) on top, producing raw_pos + cursor instead of just cursor. Fix: seed 'earliest' from the first real event encountered rather than from the caller-supplied sentinel. Subsequent points are compared against that real baseline, so the leftmost selected node correctly becomes position 0 in the copy buffer, and paste lands exactly at the edit cursor regardless of where the automation sits on the timeline.
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.
When automation points are selected and copied (Ctrl+C / Ctrl+V or Ctrl+D), the pasted automation was placed far to the right of the paste cursor -- as if the entire automation lane from the start of the song was being copied rather than just the selected nodes.
Root cause: cut_copy_points() tracks the earliest selected point in order to normalise the copy buffer to zero-relative offsets before storing it. It initialised 'earliest' from the earliest_time parameter, which callers pass as timepos_t(AudioTime) == 0 samples. Since 0 is always <= any real event position on the timeline, std::min() always kept 0 as 'earliest'. shift_earlier(0) was then a no-op, leaving every event in the copy buffer at its raw model-space position (e.g. 30 seconds into the song). On paste, paste_one() adds model_pos (the paste cursor position) on top, producing raw_pos + cursor instead of just cursor.
Fix: seed 'earliest' from the first real event encountered rather than from the caller-supplied sentinel. Subsequent points are compared against that real baseline, so the leftmost selected node correctly becomes position 0 in the copy buffer, and paste lands exactly at the edit cursor regardless of where the automation sits on the timeline.
basically, the issue was, when selecting automation points and pasting it somewhere else, it would also paste the start of the automation lane, when it should just paste the nodes that you selected. i would expect it to paste the left most node that you selected where your cursor is.
related to this https://tracker.ardour.org/view.php?id=9771