diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-11-24 21:58:56 +0200 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-11-24 21:59:29 +0200 |
commit | d953f1ce0e65d59c529f40ddc8da0e80db0dfbfb (patch) | |
tree | dcf036bc4d9850dae612cc514e604ae9e4fbd59a /gtk2_ardour | |
parent | 78218e8c0730c4a93a881fcbcca995b62cf3e3c7 (diff) |
when dragging on the canvas, use x,y pointer coordinates to decide if motion has occured.
Using _last_pointer_frame breaks when dragging to the left of the canvas, because we clamp
the value of the frame to >= 0. Motion would step once the pointer crossed the left edge
of the canvas because the frame value would always be zero.
This is not a problem when using the pointer x,y values which end up appropriately negative
under all conditions.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 9 | ||||
-rw-r--r-- | gtk2_ardour/editor_drag.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 30cad7771d..9e03846d40 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -339,6 +339,12 @@ Drag::adjusted_current_frame (GdkEvent const * event, bool snap) const } double +Drag::current_pointer_x() const +{ + return _drags->current_pointer_x (); +} + +double Drag::current_pointer_y () const { if (!_trackview_only) { @@ -353,7 +359,7 @@ Drag::motion_handler (GdkEvent* event, bool from_autoscroll) { /* check to see if we have moved in any way that matters since the last motion event */ if (_move_threshold_passed && - (!x_movement_matters() || _last_pointer_frame == adjusted_current_frame (event)) && + (!x_movement_matters() || _last_pointer_x == current_pointer_x ()) && (!y_movement_matters() || _last_pointer_y == current_pointer_y ()) ) { return false; } @@ -2604,6 +2610,7 @@ MeterMarkerDrag::motion (GdkEvent* event, bool first_move) } framepos_t const pf = adjusted_current_frame (event); + _marker->set_position (pf); show_verbose_cursor_time (pf); } diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index 3c1eef70f6..9b4a0a6521 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -211,6 +211,7 @@ protected: return _last_pointer_frame; } + double current_pointer_x () const; double current_pointer_y () const; boost::shared_ptr<ARDOUR::Region> add_midi_region (MidiTimeAxisView*); |