diff options
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r-- | gtk2_ardour/editor.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index e50ef98290..d6ab14dafc 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -3887,16 +3887,10 @@ Editor::get_paste_offset (framepos_t pos, unsigned paste_count, framecnt_t durat /* calculate basic unsnapped multi-paste offset */ framecnt_t offset = paste_count * duration; - bool success = true; - double snap_beats = get_grid_type_as_beats(success, pos); - if (success) { - /* we're snapped to something musical, round duration up */ - BeatsFramesConverter conv(_session->tempo_map(), pos); - const Evoral::MusicalTime dur_beats = conv.from(duration); - const framecnt_t snap_dur_beats = ceil(dur_beats / snap_beats) * snap_beats; - - offset = paste_count * conv.to(snap_dur_beats); - } + /* snap offset so pos + offset is aligned to the grid */ + framepos_t offset_pos = pos + offset; + snap_to(offset_pos, RoundUpMaybe); + offset = offset_pos - pos; return offset; } |