13
0

Prevent note creation drags with no movement of the pointer. May fix #3159.

git-svn-id: svn://localhost/ardour2/branches/3.0@7146 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-05-24 14:45:10 +00:00
parent 88f13bbe33
commit a4664d68c0

View File

@ -347,6 +347,10 @@ MidiRegionView::canvas_event(GdkEvent* ev)
return false;
case GDK_BUTTON_PRESS:
last_x = ev->button.x;
last_y = ev->button.y;
group->w2i (last_x, last_y);
if (_mouse_state != SelectTouchDragging && ev->button.button == 1) {
_pressed_button = ev->button.button;
_mouse_state = Pressed;
@ -376,7 +380,12 @@ MidiRegionView::canvas_event(GdkEvent* ev)
event_frame -= _region->position();
switch (_mouse_state) {
case Pressed: // Drag start
case Pressed: // Maybe start a drag, if we've moved a bit
if (fabs (event_x - last_x) < 1 && fabs (event_y - last_y) < 1) {
/* no appreciable movement since the button was pressed */
return false;
}
// Select drag start
if (_pressed_button == 1 && editor.current_mouse_mode() == MouseObject) {
@ -496,7 +505,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
if (!success) {
beats = 1;
}
create_note_at (event_x, event_y, beats);
break;
}