summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-12-01 18:25:36 +0000
committerCarl Hetherington <carl@carlh.net>2009-12-01 18:25:36 +0000
commitce2d9cb4aacae917fd9117d923f124a8d5ecde2d (patch)
treeb68473c8666e9265f3bcef1d005f9a5a8e444296 /gtk2_ardour
parent2ee9fb4d33452e0641ec18b08571447c6418c1a8 (diff)
Stop editor summary viewbox being moved too far down in y.
git-svn-id: svn://localhost/ardour2/branches/3.0@6253 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_summary.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc
index 555c56edfc..764ec31a30 100644
--- a/gtk2_ardour/editor_summary.cc
+++ b/gtk2_ardour/editor_summary.cc
@@ -453,8 +453,26 @@ EditorSummary::set_editor (pair<double,double> const & x, pair<double, double> c
is merely pending but not executing. But c'est la vie.
*/
+ /* proposed bottom of the editor with the requested position */
+ double const pb = y.second / _y_scale;
+
+ /* bottom of the canvas */
+ double const ch = _editor->full_canvas_height - _editor->canvas_timebars_vsize;
+
+ /* requested y position */
+ double ly = y.first / _y_scale;
+
+ /* clamp y position so as not to go off the bottom */
+ if (pb > ch) {
+ ly -= (pb - ch);
+ }
+
+ if (ly < 0) {
+ ly = 0;
+ }
+
_editor->reset_x_origin (x.first / _x_scale + _start);
- _editor->reset_y_origin (y.first / _y_scale);
+ _editor->reset_y_origin (ly);
double const nx = (
((x.second - x.first) / _x_scale) /