From 25d17e857f3517e8629811e6989ca8e0a6d1cdb5 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 10 Jul 2023 13:42:25 -0600 Subject: [PATCH] when free-drawing straight lines, allow retrograde motion --- gtk2_ardour/editor_drag.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index a1808fdaf6..c5ebecee34 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -7320,21 +7320,21 @@ AutomationDrawDrag::maybe_add_point (GdkEvent* ev, timepos_t const & cpos) bool add_point = false; bool pop_point = false; - if (direction > 0) { - if ((pointer_x > edge_x) || (pointer_x == edge_x && ev->motion.y != last_pointer_y())) { + const bool line = Keyboard::modifier_state_equals (ev->motion.state, Keyboard::PrimaryModifier); - bool line = Keyboard::modifier_state_equals (ev->motion.state, Keyboard::PrimaryModifier); + if (direction > 0) { + if (line || (pointer_x > edge_x) || (pointer_x == edge_x && ev->motion.y != last_pointer_y())) { if (line && dragging_line->get().size() > 1) { pop_point = true; } + add_point = true; } - } else if (direction < 0) { - if ((pointer_x < edge_x) || (pointer_x == edge_x && ev->motion.y != last_pointer_y())) { - bool line = Keyboard::modifier_state_equals (ev->motion.state, Keyboard::PrimaryModifier); + } else if (direction < 0) { + if (line || (pointer_x < edge_x) || (pointer_x == edge_x && ev->motion.y != last_pointer_y())) { if (line && dragging_line->get().size() > 1) { pop_point = true;