diff --git a/gtk2_ardour/velocity_display.cc b/gtk2_ardour/velocity_display.cc index 35fec17b19..d04baf95b7 100644 --- a/gtk2_ardour/velocity_display.cc +++ b/gtk2_ardour/velocity_display.cc @@ -203,12 +203,15 @@ VelocityDisplay::set_size_and_position (GhostEvent& gev) void VelocityDisplay::update_note (NoteBase* nb) { - GhostEvent* gev = GhostEvent::find (nb->note(), events, _optimization_iterator); + auto iter = events.end(); + + GhostEvent* gev = GhostEvent::find (nb->note(), events, iter); if (!gev) { return; } + _optimization_iterator = iter; update_ghost_event (gev); } @@ -319,7 +322,9 @@ VelocityDisplay::y_position_to_velocity (double y) const void VelocityDisplay::note_selected (NoteBase* ev) { - GhostEvent* gev = GhostEvent::find (ev->note(), events, _optimization_iterator); + auto ignore_optiter = events.end(); + + GhostEvent* gev = GhostEvent::find (ev->note(), events, ignore_optiter); if (!gev) { return;