summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-08-20 01:46:04 +1000
committernick_m <mainsbridge@gmail.com>2016-08-20 01:46:04 +1000
commit269a08a2b1cdf1f72c49c715f85ead2e16911854 (patch)
treec704d3e279504a2198bd6b8581af11b1d039d5f1 /gtk2_ardour/editor_drag.cc
parent2d7bdda0be0fca64a51c2e26c992a25a517541eb (diff)
Allow both types of constrained drag (again).
- Holding the constraint modifier at the time of grab gives constrained x. - Holding the constraint modifier after the grab but before the first motion constrains to the direction of first movement.
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 98ccf4a6a2..07f6c23d71 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -264,6 +264,15 @@ Drag::start_grab (GdkEvent* event, Gdk::Cursor *cursor)
/* we set up x/y dragging constraints on first move */
_constraint_pressed = ArdourKeyboard::indicates_constraint (event->button.state);
+ if (_constraint_pressed) {
+ /* if constraint was indicated at the beginning of the drag, constrain x.
+ if the user presses these modifiers after this point in time (first move),
+ the drag will be constrained to the first direction of motion.
+ */
+ _x_constrained = true;
+ _y_constrained = false;
+ }
+
_raw_grab_frame = _editor->canvas_event_sample (event, &_grab_x, &_grab_y);
setup_pointer_frame_offset ();
@@ -429,7 +438,7 @@ Drag::motion_handler (GdkEvent* event, bool from_autoscroll)
_x_constrained = true;
_y_constrained = false;
}
- } else if (_constraint_pressed) {
+ } else if (!_constraint_pressed && ArdourKeyboard::indicates_constraint (event->button.state)) {
// if dragging normally, the motion is constrained to the first direction of movement.
if (_initially_vertical) {
_x_constrained = true;