automation region paste: snap at paste, not at cut

This fixes various issues with this operation, mostly because it was really the
wrong concept to begin with.
This commit is contained in:
Paul Davis
2022-10-26 22:23:14 -06:00
parent fa858a0386
commit a6b63b1cca
2 changed files with 9 additions and 14 deletions

View File

@@ -253,8 +253,15 @@ AutomationRegionView::paste (timepos_t const & pos
/* add multi-paste offset if applicable */
p += view->editor ().get_paste_offset (pos, paste_count > 0 ? 1 : 0, len);
/* convert sample-position to model's unit and position */
timepos_t model_pos = timepos_t (source_relative_distance (timecnt_t (p, timepos_t()), slist->time_domain()));
timepos_t model_pos = pos;
/* potentially snap */
view->editor().snap_to (model_pos, Temporal::RoundNearest);
/* convert timeline position to model's (source-relative) position */
model_pos = timepos_t (_region->source_position().distance (model_pos));
XMLNode& before = my_list->get_state();
my_list->paste (*slist, model_pos);

View File

@@ -4584,18 +4584,6 @@ Editor::cut_copy_points (Editing::CutCopyOp op, timepos_t const & earliest_time)
earliest = std::min (earliest, (*ctrl_evt)->when);
}
/* Snap start time backwards, so copy/paste is snap aligned. */
if (earliest != timepos_t::max (earliest.time_domain())) {
if (earliest.time_domain() == Temporal::BeatTime) {
/* always just round down to beat */
earliest = timepos_t (earliest.beats().round_down_to_beat());
} else {
/* do actual snap */
snap_to (earliest, Temporal::RoundDownMaybe);
}
}
for (Lists::iterator i = lists.begin(); i != lists.end(); ++i) {
/* Correct this copy list so that it is relative to the earliest
start time, so relative ordering between points is preserved