From 615aff92d75cb857ff0b896055a1315e1f5147a1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 19 Dec 2022 12:01:05 -0700 Subject: [PATCH] note create drags: work better if snapping to bars --- gtk2_ardour/editor_drag.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 67f1ce37e4..e8770bcfef 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -6745,13 +6745,11 @@ void NoteCreateDrag::motion (GdkEvent* event, bool) { const timepos_t pos = _drags->current_pointer_time (); - Temporal::Beats aligned_beats = round_to_grid (pos, event); //when the user clicks and starts a drag to define the note's length, require notes to be at least |this| long const Temporal::Beats min_length (_region_view->get_draw_length_beats (pos)); - aligned_beats = aligned_beats+min_length; - - _note[1] = timepos_t (max (Temporal::Beats(), aligned_beats)); + Temporal::Beats aligned_beats = round_to_grid (pos, event); + _note[1] = std::max (aligned_beats, (pos.beats() + min_length)); const timecnt_t rrp1 (_region_view->region()->region_relative_position (_note[0])); const timecnt_t rrp2 (_region_view->region()->region_relative_position (_note[1]));