frameoffset_t
Drag::snap_delta (GdkEvent const * event) const
{
- if (Keyboard::modifier_state_contains (event->button.state, Keyboard::TertiaryModifier)) {
+ if (Keyboard::modifier_state_equals (event->button.state, Keyboard::snap_delta_modifier())) {
return 0;
} else {
return _snap_delta;
/* just changed */
if (fabs (current_pointer_y() - _grab_y) > fabs (current_pointer_x() - _grab_x)) {
- if (event->motion.state & Gdk::BUTTON2_MASK) {
+ if ((event->motion.state & Gdk::BUTTON2_MASK) && Config->get_edit_mode() != Lock) {
_x_constrained = true;
_y_constrained = false;
}
_initially_vertical = true;
} else {
- if (event->motion.state & Gdk::BUTTON2_MASK) {
+ if ((event->motion.state & Gdk::BUTTON2_MASK) && Config->get_edit_mode() != Lock) {
_x_constrained = false;
_y_constrained = true;
}
_initially_vertical = false;
}
+
+ if (Config->get_edit_mode() == Lock) {
+ if (event->button.state & Gdk::BUTTON2_MASK) {
+ _x_constrained = false;
+ } else {
+ _x_constrained = true;
+ }
+ _y_constrained = false;
+ }
}
if (!from_autoscroll) {
double dx = 0;
- /* in locked edit mode, reverse the usual meaning of _x_constrained */
- bool const x_move_allowed = Config->get_edit_mode() == Lock ? _x_constrained : !_x_constrained;
+ bool const x_move_allowed = !_x_constrained;
if ((*pending_region_position != _last_frame_position) && x_move_allowed) {
return;
}
- /* reverse this here so that we have the correct logic to finalize
- the drag.
- */
-
- if (Config->get_edit_mode() == Lock) {
- _x_constrained = !_x_constrained;
- }
-
assert (!_views.empty ());
/* We might have hidden region views so that they weren't visible during the drag
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*r);
if (mrv) {
double sd = 0.0;
- if (Keyboard::modifier_state_contains (event->button.state, Keyboard::TertiaryModifier)) {
+ if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::snap_delta_modifier())) {
sd = _snap_delta;
}
mrv->update_resizing (nb, at_front, _drags->current_pointer_x() - grab_x(), relative, sd);
assert (nb);
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*r);
double sd = 0.0;
- if (Keyboard::modifier_state_contains (event->button.state, Keyboard::TertiaryModifier)) {
+ if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::snap_delta_modifier())) {
sd = _snap_delta;
}
if (mrv) {