Correctly handle Zoom > Edit-point > Mouse
Previously this failed if the event was initiated outside of the canvas (e.g. Zoom buttons). This also fixes a special case of Zooming to an edit-point at zero.
This commit is contained in:
parent
9851c9b08a
commit
fb4cbb9f9e
|
@ -1800,7 +1800,13 @@ Editor::temporal_zoom (samplecnt_t fpp)
|
||||||
new_page_size = (samplepos_t) floor (_visible_canvas_width * nfpp);
|
new_page_size = (samplepos_t) floor (_visible_canvas_width * nfpp);
|
||||||
half_page_size = new_page_size / 2;
|
half_page_size = new_page_size / 2;
|
||||||
|
|
||||||
switch (zoom_focus) {
|
Editing::ZoomFocus zf = zoom_focus;
|
||||||
|
|
||||||
|
if (zf == ZoomFocusEdit && _edit_point == EditAtMouse) {
|
||||||
|
zf = ZoomFocusMouse;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (zf) {
|
||||||
case ZoomFocusLeft:
|
case ZoomFocusLeft:
|
||||||
leftmost_after_zoom = current_leftmost;
|
leftmost_after_zoom = current_leftmost;
|
||||||
break;
|
break;
|
||||||
|
@ -1870,9 +1876,7 @@ Editor::temporal_zoom (samplecnt_t fpp)
|
||||||
case ZoomFocusEdit:
|
case ZoomFocusEdit:
|
||||||
/* try to keep the edit point in the same place */
|
/* try to keep the edit point in the same place */
|
||||||
where = get_preferred_edit_position ();
|
where = get_preferred_edit_position ();
|
||||||
|
{
|
||||||
if (where > 0) {
|
|
||||||
|
|
||||||
double l = - ((new_page_size * ((where - current_leftmost)/(double)current_page)) - where);
|
double l = - ((new_page_size * ((where - current_leftmost)/(double)current_page)) - where);
|
||||||
|
|
||||||
if (l < 0) {
|
if (l < 0) {
|
||||||
|
@ -1882,10 +1886,6 @@ Editor::temporal_zoom (samplecnt_t fpp)
|
||||||
} else {
|
} else {
|
||||||
leftmost_after_zoom = (samplepos_t) l;
|
leftmost_after_zoom = (samplepos_t) l;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
/* edit point not defined */
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user