summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-01-31 19:24:26 +0000
committerCarl Hetherington <carl@carlh.net>2012-01-31 19:24:26 +0000
commit3b5787c4617107cd7e5854877408f229e06dce25 (patch)
tree54bb0789c42e543a227fed39c6ca45c504a40aa7
parent9383f8e09e4f32ba4ab5b2bd925ecfe7ed2a7784 (diff)
Fix position of viewport after a playhead drag outside the viewport (when following the playhead).
git-svn-id: svn://localhost/ardour2/branches/3.0@11399 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/editor.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 8a00a3e501..644c74c482 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -5102,32 +5102,33 @@ Editor::reset_x_origin_to_follow_playhead ()
} else {
+ framepos_t l = 0;
+
if (frame < leftmost_frame) {
/* moving left */
- framepos_t l = 0;
if (_session->transport_rolling()) {
/* rolling; end up with the playhead at the right of the page */
l = frame - current_page_frames ();
} else {
- /* not rolling: end up with the playhead 3/4 of the way along the page */
- l = frame - (3 * current_page_frames() / 4);
- }
-
- if (l < 0) {
- l = 0;
+ /* not rolling: end up with the playhead 1/4 of the way along the page */
+ l = frame - current_page_frames() / 4;
}
-
- center_screen_internal (l + (current_page_frames() / 2), current_page_frames ());
} else {
/* moving right */
if (_session->transport_rolling()) {
/* rolling: end up with the playhead on the left of the page */
- center_screen_internal (frame + (current_page_frames() / 2), current_page_frames ());
+ l = frame;
} else {
- /* not rolling: end up with the playhead 1/4 of the way along the page */
- center_screen_internal (frame + (current_page_frames() / 4), current_page_frames ());
+ /* not rolling: end up with the playhead 3/4 of the way along the page */
+ l = frame - 3 * current_page_frames() / 4;
}
}
+
+ if (l < 0) {
+ l = 0;
+ }
+
+ center_screen_internal (l + (current_page_frames() / 2), current_page_frames ());
}
}
}