summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_mixer.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-01-06 01:36:20 +0000
committerCarl Hetherington <carl@carlh.net>2010-01-06 01:36:20 +0000
commitea7cb51ed8f7193de6e800bc482ffa30c18047f4 (patch)
tree02a9a83eeb07b4d829c04d529c3598bcc82f0b47 /gtk2_ardour/editor_mixer.cc
parente2981526ea4636411fb11c146900d6f6e0b9ba79 (diff)
When moving around using nudge / move to next region etc., arrange the canvas so that the playhead is either a quarter of the way from the left (when moving right) or a quarter of the way from the right (when moving left).
git-svn-id: svn://localhost/ardour2/branches/3.0@6461 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_mixer.cc')
-rw-r--r--gtk2_ardour/editor_mixer.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc
index b2cca47e98..21a35f6da3 100644
--- a/gtk2_ardour/editor_mixer.cc
+++ b/gtk2_ardour/editor_mixer.cc
@@ -243,8 +243,20 @@ Editor::update_current_screen ()
} else {
center_screen (current_page_frames()/2);
}
+
} else {
- center_screen (frame+(current_page_frames()/2));
+
+ if (frame < leftmost_frame) {
+ /* moving left: end up with the playhead 3/4 of the way along the page */
+ nframes64_t l = frame - (3 * current_page_frames() / 4);
+ if (l < 0) {
+ l = 0;
+ }
+ center_screen_internal (l + (current_page_frames() / 2), current_page_frames ());
+ } else {
+ /* moving right: end up with the playhead 1/4 of the way along the page */
+ center_screen_internal (frame + (current_page_frames() / 4), current_page_frames ());
+ }
}
}