mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 12:16:30 +01:00
Use the frame corresponding to the current mouse position when zoom dragging
Editor::mouse_frame only works within the track canvas. If a zoom drag is initiated and the mouse cursor goes outside of the track canvas the zoom position should still based on the current x position of the cursor.
This commit is contained in:
parent
9485748e17
commit
37a7d87786
1 changed files with 16 additions and 12 deletions
|
|
@ -1768,6 +1768,7 @@ Editor::temporal_zoom (framecnt_t fpp)
|
||||||
framepos_t leftmost_after_zoom = 0;
|
framepos_t leftmost_after_zoom = 0;
|
||||||
framepos_t where;
|
framepos_t where;
|
||||||
bool in_track_canvas;
|
bool in_track_canvas;
|
||||||
|
bool use_mouse_frame = true;
|
||||||
framecnt_t nfpp;
|
framecnt_t nfpp;
|
||||||
double l;
|
double l;
|
||||||
|
|
||||||
|
|
@ -1828,18 +1829,13 @@ Editor::temporal_zoom (framecnt_t fpp)
|
||||||
case ZoomFocusMouse:
|
case ZoomFocusMouse:
|
||||||
/* try to keep the mouse over the same point in the display */
|
/* try to keep the mouse over the same point in the display */
|
||||||
|
|
||||||
if (!mouse_frame (where, in_track_canvas)) {
|
if (_drags->active()) {
|
||||||
/* use playhead instead */
|
where = _drags->current_pointer_frame ();
|
||||||
where = playhead_cursor->current_frame ();
|
} else if (!mouse_frame (where, in_track_canvas)) {
|
||||||
|
use_mouse_frame = false;
|
||||||
if (where < half_page_size) {
|
|
||||||
leftmost_after_zoom = 0;
|
|
||||||
} else {
|
|
||||||
leftmost_after_zoom = where - half_page_size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
if (use_mouse_frame) {
|
||||||
|
|
||||||
l = - ((new_page_size * ((where - current_leftmost)/(double)current_page)) - where);
|
l = - ((new_page_size * ((where - current_leftmost)/(double)current_page)) - where);
|
||||||
|
|
||||||
if (l < 0) {
|
if (l < 0) {
|
||||||
|
|
@ -1849,8 +1845,16 @@ Editor::temporal_zoom (framecnt_t fpp)
|
||||||
} else {
|
} else {
|
||||||
leftmost_after_zoom = (framepos_t) l;
|
leftmost_after_zoom = (framepos_t) l;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
/* use playhead instead */
|
||||||
|
where = playhead_cursor->current_frame ();
|
||||||
|
|
||||||
|
if (where < half_page_size) {
|
||||||
|
leftmost_after_zoom = 0;
|
||||||
|
} else {
|
||||||
|
leftmost_after_zoom = where - half_page_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZoomFocusEdit:
|
case ZoomFocusEdit:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue