diff options
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 20 | ||||
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 7 | ||||
-rw-r--r-- | gtk2_ardour/rc_option_editor.cc | 2 | ||||
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/keyboard.h | 4 |
4 files changed, 22 insertions, 11 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 00811f6eea..9d2c53964e 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -339,10 +339,10 @@ frameoffset_t Drag::snap_delta (guint state) const { if (ArdourKeyboard::indicates_snap_delta (state)) { - return 0; + return _snap_delta; } - return _snap_delta; + return 0; } double @@ -2410,7 +2410,7 @@ NoteResizeDrag::motion (GdkEvent* event, bool /*first_move*/) if (mrv) { double sd = 0.0; bool snap = true; - bool apply_snap_delta = !ArdourKeyboard::indicates_snap_delta (event->button.state); + bool apply_snap_delta = ArdourKeyboard::indicates_snap_delta (event->button.state); if (ArdourKeyboard::indicates_snap (event->button.state)) { if (_editor->snap_mode () != SnapOff) { @@ -2420,7 +2420,7 @@ NoteResizeDrag::motion (GdkEvent* event, bool /*first_move*/) if (_editor->snap_mode () == SnapOff) { snap = false; /* inverted logic here - we;re in snapoff but we've pressed the snap delta modifier */ - if (!apply_snap_delta) { + if (apply_snap_delta) { snap = true; } } @@ -2445,7 +2445,7 @@ NoteResizeDrag::finished (GdkEvent* event, bool /*movement_occurred*/) MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*r); double sd = 0.0; bool snap = true; - bool apply_snap_delta = !ArdourKeyboard::indicates_snap_delta (event->button.state); + bool apply_snap_delta = ArdourKeyboard::indicates_snap_delta (event->button.state); if (mrv) { if (ArdourKeyboard::indicates_snap (event->button.state)) { if (_editor->snap_mode () != SnapOff) { @@ -2455,7 +2455,7 @@ NoteResizeDrag::finished (GdkEvent* event, bool /*movement_occurred*/) if (_editor->snap_mode () == SnapOff) { snap = false; /* inverted logic here - we;re in snapoff but we've pressed the snap delta modifier */ - if (!apply_snap_delta) { + if (apply_snap_delta) { snap = true; } } @@ -5278,7 +5278,13 @@ NoteDrag::total_dx (const guint state) const } } - return _region->snap_frame_to_frame (st - rp, snap) + rp - n - snap_delta (state); + frameoffset_t ret; + if (snap) { + ret = _region->snap_frame_to_frame (st - rp, snap) + rp - n - snap_delta (state); + } else { + ret = st - n - snap_delta (state); + } + return ret; } /** @return Current total drag y change in note number */ diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 742d7d9793..fd869af0e7 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -2893,7 +2893,12 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_ } /* Convert the new x position to a frame within the source */ - const framepos_t current_fr = snap_pixel_to_sample (current_x, with_snap) + _region->start (); + framepos_t current_fr; + if (with_snap) { + current_fr = snap_pixel_to_sample (current_x, with_snap) + _region->start (); + } else { + current_fr = trackview.editor().pixel_to_sample (current_x) + _region->start (); + } /* and then to beats */ const Evoral::Beats x_beats = region_frames_to_region_beats (current_fr); diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index a12fa90f4c..bb0042cf79 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -605,7 +605,7 @@ public: } } - l = manage (left_aligned_label (_("Snap to absolute using:"))); + l = manage (left_aligned_label (_("Snap relatively using:"))); l->set_name ("OptionsLabel"); t->attach (*l, col, col + 1, row, row + 1, FILL | EXPAND, FILL); diff --git a/libs/gtkmm2ext/gtkmm2ext/keyboard.h b/libs/gtkmm2ext/gtkmm2ext/keyboard.h index 3ffa09f036..73c9ad7d42 100644 --- a/libs/gtkmm2ext/gtkmm2ext/keyboard.h +++ b/libs/gtkmm2ext/gtkmm2ext/keyboard.h @@ -126,8 +126,8 @@ class LIBGTKMM2EXT_API Keyboard : public sigc::trackable, PBD::Stateful * Absolute grid is for aligning objects with the grid lines. * Relative grid is for maintaining an initial position relative to the grid lines. * With this modifier: - * - magnetic or normal grid should snap absolutely to the grid lines - * - no grid should become absolute grid. + * - magnetic or normal grid should snap relative to an initial grid offset + * - no grid should snap relative to the grid. */ static ModifierMask snap_delta_modifier () { return ModifierMask (snap_delta_mod); } |