summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-10-16 03:47:10 +1100
committernick_m <mainsbridge@gmail.com>2016-10-16 03:47:10 +1100
commit0b509454840aaf27cfa7fb37bfb039c082cebaa1 (patch)
treee69d9d523980024a582c8e7a3d740f218ddf2b4b /gtk2_ardour/editor_drag.cc
parent2c844552a7556c005d5d1e3374514ba877e52d52 (diff)
Fix various snap issues when dragging control points (AutomationRegionView).
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index bbe0aca428..99481f38a2 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -4327,7 +4327,7 @@ ControlPointDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*cursor*/)
// start the grab at the center of the control point so
// the point doesn't 'jump' to the mouse after the first drag
- _fixed_grab_x = _point->get_x();
+ _fixed_grab_x = _point->get_x() + _editor->sample_to_pixel_unrounded (_point->line().offset());
_fixed_grab_y = _point->get_y();
framepos_t pos = _editor->pixel_to_sample (_fixed_grab_x);
@@ -4385,13 +4385,12 @@ ControlPointDrag::motion (GdkEvent* event, bool first_motion)
}
framepos_t cx_frames = _editor->pixel_to_sample (cx) + snap_delta (event->button.state);
-
if (!_x_constrained && need_snap) {
_editor->snap_to_with_modifier (cx_frames, event);
}
cx_frames -= snap_delta (event->button.state);
- cx_frames = min (cx_frames, _point->line().maximum_time());
+ cx_frames = min (cx_frames, _point->line().maximum_time() + _point->line().offset());
float const fraction = 1.0 - (cy / _point->line().height());