summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_ops.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r--gtk2_ardour/editor_ops.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index c4c6f18ac8..48968378eb 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -1800,7 +1800,13 @@ Editor::temporal_zoom (samplecnt_t fpp)
new_page_size = (samplepos_t) floor (_visible_canvas_width * nfpp);
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:
leftmost_after_zoom = current_leftmost;
break;
@@ -1870,9 +1876,7 @@ Editor::temporal_zoom (samplecnt_t fpp)
case ZoomFocusEdit:
/* try to keep the edit point in the same place */
where = get_preferred_edit_position ();
-
- if (where > 0) {
-
+ {
double l = - ((new_page_size * ((where - current_leftmost)/(double)current_page)) - where);
if (l < 0) {
@@ -1882,10 +1886,6 @@ Editor::temporal_zoom (samplecnt_t fpp)
} else {
leftmost_after_zoom = (samplepos_t) l;
}
-
- } else {
- /* edit point not defined */
- return;
}
break;