From: nick_m Date: Mon, 21 Nov 2016 15:01:01 +0000 (+1100) Subject: prevent Percussive mode from displaying a ghost hit at region end. X-Git-Tag: 5.5~82 X-Git-Url: https://main.carlh.net/gitweb/?p=ardour.git;a=commitdiff_plain;h=8e8c4a73f1e26dcafe055063bc8aa15736d81f8b;ds=sidebyside prevent Percussive mode from displaying a ghost hit at region end. --- diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index c0d8a3c599..76209d6c59 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -3755,6 +3755,13 @@ MidiRegionView::update_ghost_note (double x, double y, uint32_t state) const bool shift_snap = midi_view()->note_mode() != Percussive; const Evoral::Beats snapped_beats = snap_frame_to_grid_underneath (unsnapped_frame, divisions, shift_snap); + /* prevent Percussive mode from displaying a ghost hit at region end */ + if (!shift_snap && snapped_beats >= midi_region()->length_beats()) { + _ghost_note->hide(); + hide_verbose_cursor (); + return; + } + /* ghost note may have been snapped before region */ if (_ghost_note && snapped_beats.to_double() < 0.0) { _ghost_note->hide();