mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 11:06:32 +01:00
control point drag: fix the way bounding-to-region is computed
This commit is contained in:
parent
2de76147d2
commit
e883c39e7a
3 changed files with 16 additions and 5 deletions
|
|
@ -4775,6 +4775,7 @@ ControlPointDrag::motion (GdkEvent* event, bool first_motion)
|
|||
cy = zero_gain_y;
|
||||
}
|
||||
|
||||
/* cx_pos is in absolute timeline units */
|
||||
timepos_t cx_pos (timepos_t (pixel_to_time (cx)) + snap_delta (event->button.state));
|
||||
|
||||
if (need_snap) {
|
||||
|
|
@ -4782,7 +4783,9 @@ ControlPointDrag::motion (GdkEvent* event, bool first_motion)
|
|||
}
|
||||
|
||||
cx_pos.shift_earlier (snap_delta (event->button.state));
|
||||
cx_pos = min (cx_pos, _point->line().maximum_time() + _point->line().offset());
|
||||
|
||||
/* total number of pixels (canvas window units) to move */
|
||||
double px = _editor->time_to_pixel_unrounded (cx_pos);
|
||||
|
||||
float const fraction = 1.0 - (cy / _point->line().height());
|
||||
|
||||
|
|
@ -4791,8 +4794,9 @@ ControlPointDrag::motion (GdkEvent* event, bool first_motion)
|
|||
_editor->begin_reversible_command (_("automation event move"));
|
||||
_point->line().start_drag_single (_point, _fixed_grab_x, initial_fraction);
|
||||
}
|
||||
|
||||
pair<float, float> result;
|
||||
result = _point->line().drag_motion (_editor->time_to_pixel_unrounded (cx_pos), fraction, false, _pushing, _final_index);
|
||||
result = _point->line().drag_motion (px, fraction, false, _pushing, _final_index);
|
||||
show_verbose_cursor_text (_point->line().get_verbose_cursor_relative_string (result.first, result.second));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue