summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2015-01-20 04:49:44 +1100
committernick_m <mainsbridge@gmail.com>2015-01-20 04:49:44 +1100
commitae7b978b0ba26f911e50bc3cbd50cc9455c94fad (patch)
tree0b9677b4a6d74d7bed0df0e187b06a77dc811199 /gtk2_ardour/editor_drag.cc
parentb0a5245ef04ca145030820c0e5d5f2cfae5fa2d5 (diff)
Fixes for when rubberbanding_snaps_to_grid config setting is off.
The initial point and the ultimately selected items were always following the snap settings. Also the VCC was displaying incorrectly on button press.
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc23
1 files changed, 16 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 34e169b133..eca6131f03 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -3849,7 +3849,7 @@ void
RubberbandSelectDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
{
Drag::start_grab (event);
- show_verbose_cursor_time (adjusted_current_frame (event));
+ show_verbose_cursor_time (adjusted_current_frame (event, ARDOUR_UI::config()->get_rubberbanding_snaps_to_grid()));
}
void
@@ -3860,11 +3860,13 @@ RubberbandSelectDrag::motion (GdkEvent* event, bool)
double y1;
double y2;
- framepos_t const pf = adjusted_current_frame (event, ARDOUR_UI::config()->get_rubberbanding_snaps_to_grid ());
+ framepos_t const pf = adjusted_current_frame (event, ARDOUR_UI::config()->get_rubberbanding_snaps_to_grid());
framepos_t grab = grab_frame ();
if (ARDOUR_UI::config()->get_rubberbanding_snaps_to_grid ()) {
_editor->snap_to_with_modifier (grab, event);
+ } else {
+ grab = raw_grab_frame ();
}
/* base start and end on initial click position */
@@ -3935,13 +3937,20 @@ RubberbandSelectDrag::do_select_things (GdkEvent* event, bool drag_in_progress)
{
framepos_t x1;
framepos_t x2;
+ framepos_t grab = grab_frame ();
+ framepos_t lpf = last_pointer_frame ();
+
+ if (!ARDOUR_UI::config()->get_rubberbanding_snaps_to_grid ()) {
+ grab = raw_grab_frame ();
+ lpf = _editor->pixel_to_sample_from_event (last_pointer_x());
+ }
- if (grab_frame() < last_pointer_frame()) {
- x1 = grab_frame ();
- x2 = last_pointer_frame ();
+ if (grab < lpf) {
+ x1 = grab;
+ x2 = lpf;
} else {
- x2 = grab_frame ();
- x1 = last_pointer_frame ();
+ x2 = grab;
+ x1 = lpf;
}
double y1;