diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-03-07 02:11:59 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-03-07 02:11:59 +0000 |
commit | 5d82179323ccadff0107143914c796e1c09c6793 (patch) | |
tree | 24fc3950a80ad855e3ec56a56638baea47226506 /gtk2_ardour/editor_ops.cc | |
parent | cbfe2f2fa56bd44536e1dbf9dbd3419b5be5f535 (diff) |
fix up a substantial mess with the operation of toggle-zoom and related actions, partially caused by XMLNode semantics fixed in a previous commit, but partially caused by issues fixed here
git-svn-id: svn://localhost/ardour2/branches/3.0@11614 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index cdad586125..70606e28be 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -31,6 +31,7 @@ #include "pbd/basename.h" #include "pbd/pthread_utils.h" #include "pbd/memento_command.h" +#include "pbd/unwind.h" #include "pbd/whitespace.h" #include "pbd/stateful_diff_command.h" @@ -1485,16 +1486,15 @@ Editor::temporal_zoom_region (bool both_axes) end = max_framepos; } - if (both_axes) { - /* save visual state with track states included, and prevent - set_frames_per_unit() from doing it again. - */ - undo_visual_stack.push_back (current_visual_state(true)); - no_save_visual = true; - } + /* if we're zooming on both axes we need to save track heights etc. + */ - temporal_zoom_by_frame (start, end, "zoom to region"); + undo_visual_stack.push_back (current_visual_state (both_axes)); + PBD::Unwinder<bool> nsv (no_save_visual, true); + + temporal_zoom_by_frame (start, end, "zoom to region"); + if (both_axes) { uint32_t per_track_height = (uint32_t) floor ((_canvas_height - canvas_timebars_vsize - 10.0) / tracks.size()); @@ -1517,10 +1517,9 @@ Editor::temporal_zoom_region (bool both_axes) _routes->resume_redisplay (); vertical_adjustment.set_value (0.0); - no_save_visual = false; } - redo_visual_stack.push_back (current_visual_state()); + redo_visual_stack.push_back (current_visual_state (both_axes)); } void @@ -6487,7 +6486,8 @@ Editor::fit_tracks (TrackViewList & tracks) return; } - undo_visual_stack.push_back (current_visual_state()); + undo_visual_stack.push_back (current_visual_state (true)); + no_save_visual = true; /* build a list of all tracks, including children */ @@ -6542,7 +6542,7 @@ Editor::fit_tracks (TrackViewList & tracks) controls_layout.property_height () = full_canvas_height - canvas_timebars_vsize; vertical_adjustment.set_value (first_y_pos); - redo_visual_stack.push_back (current_visual_state()); + redo_visual_stack.push_back (current_visual_state (true)); } void |