From f979d9c0a633181e75721eb4ddb7cf43333f529d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Wed, 2 Dec 2015 11:20:56 +0100 Subject: [PATCH] Don't show a ghost note when draw mode is entered over a note. --- gtk2_ardour/midi_region_view.cc | 54 ++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 22d1488367..cab955ed3d 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -609,33 +609,32 @@ MidiRegionView::motion (GdkEventMotion* ev) { PublicEditor& editor = trackview.editor (); - if (_note_entered) { + if (!_note_entered) { - remove_ghost_note (); + if (!_ghost_note && editor.current_mouse_mode() == MouseContent && + Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()) && + _mouse_state != AddDragging) { - } else if (!_ghost_note && editor.current_mouse_mode() == MouseContent && - Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()) && - _mouse_state != AddDragging) { - - create_ghost_note (ev->x, ev->y); - - } else if (_ghost_note && editor.current_mouse_mode() == MouseContent && - Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier())) { - - update_ghost_note (ev->x, ev->y); - - } else if (_ghost_note && editor.current_mouse_mode() == MouseContent) { - - remove_ghost_note (); - hide_verbose_cursor (); - - } else if (editor.current_mouse_mode() == MouseDraw) { - - if (_ghost_note) { - update_ghost_note (ev->x, ev->y); - } - else { create_ghost_note (ev->x, ev->y); + + } else if (_ghost_note && editor.current_mouse_mode() == MouseContent && + Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier())) { + + update_ghost_note (ev->x, ev->y); + + } else if (_ghost_note && editor.current_mouse_mode() == MouseContent) { + + remove_ghost_note (); + hide_verbose_cursor (); + + } else if (editor.current_mouse_mode() == MouseDraw) { + + if (_ghost_note) { + update_ghost_note (ev->x, ev->y); + } + else { + create_ghost_note (ev->x, ev->y); + } } } @@ -3328,10 +3327,17 @@ MidiRegionView::note_entered(NoteBase* ev) Editor* editor = dynamic_cast(&trackview.editor()); if (_mouse_state == SelectTouchDragging) { + note_selected (ev, true); + } else if (editor->current_mouse_mode() == MouseContent) { + + remove_ghost_note (); show_verbose_cursor (ev->note ()); + } else if (editor->current_mouse_mode() == MouseDraw) { + + remove_ghost_note (); show_verbose_cursor (ev->note ()); } }