From 41815f8d53141009dbc7e98cbe2a2f774f89ddf4 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Thu, 12 May 2022 11:59:47 -0500 Subject: [PATCH] midi_region_view: use absolute_time_to_region_beats * this fixes the location of the 'ghost note' that is shown when adding notes with the Draw tool --- gtk2_ardour/midi_region_view.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index c5072c87ee..b08b4cef12 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -4094,7 +4094,8 @@ MidiRegionView::update_ghost_note (double x, double y, uint32_t state) samplepos_t const unsnapped_sample = editor.pixel_to_sample (global_x); Temporal::timepos_t snapped_pos = timepos_t (unsnapped_sample); editor.snap_to (snapped_pos, RoundDownAlways, SnapToGrid_Scaled); - const Temporal::Beats snapped_beats = _region->position().distance (snapped_pos).beats (); + + const Temporal::Beats snapped_beats = _region->absolute_time_to_region_beats(snapped_pos); /* prevent Percussive mode from displaying a ghost hit at region end */ if ((midi_view()->note_mode() == Percussive) && (snapped_beats >= _region->length().beats())) {