diff options
author | Carl Hetherington <carl@carlh.net> | 2011-09-14 13:57:20 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-09-14 13:57:20 +0000 |
commit | 74796c7a531d71f29c9e603fe33998f19cb96622 (patch) | |
tree | d232ad02017f0bb3b48287fbc3c6e7ef70875122 /gtk2_ardour/editor_summary.cc | |
parent | aadc91d7d1e12bb5de406ff3ce8b504579abd210 (diff) |
Clamp left hand side zoom drags of the summary (fixes
#4317).
git-svn-id: svn://localhost/ardour2/branches/3.0@10075 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_summary.cc')
-rw-r--r-- | gtk2_ardour/editor_summary.cc | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 1c9ca94021..0c6f1cac58 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -608,7 +608,7 @@ EditorSummary::set_editor (double const x, double const y) * x and y parameters are specified in summary coordinates. */ void -EditorSummary::set_editor (pair<double,double> const & x, double const y) +EditorSummary::set_editor (pair<double,double> const x, double const y) { if (_editor->pending_visual_change.idle_handler_id >= 0) { /* see comment in other set_editor () */ @@ -624,7 +624,7 @@ EditorSummary::set_editor (pair<double,double> const & x, double const y) * x and y parameters are specified in summary coordinates. */ void -EditorSummary::set_editor (pair<double,double> const & x, pair<double, double> const & y) +EditorSummary::set_editor (pair<double,double> const x, pair<double, double> const y) { if (_editor->pending_visual_change.idle_handler_id >= 0) { /* see comment in other set_editor () */ @@ -640,8 +640,12 @@ EditorSummary::set_editor (pair<double,double> const & x, pair<double, double> c * @param x new x left position in summary coordinates. */ void -EditorSummary::set_editor_x (double const x) +EditorSummary::set_editor_x (double x) { + if (x < 0) { + x = 0; + } + _editor->reset_x_origin (x / _x_scale + _start); } @@ -650,8 +654,16 @@ EditorSummary::set_editor_x (double const x) * @param x new x range in summary coordinates. */ void -EditorSummary::set_editor_x (pair<double, double> const & x) +EditorSummary::set_editor_x (pair<double, double> x) { + if (x.first < 0) { + x.first = 0; + } + + if (x.second < 0) { + x.second = 1; + } + _editor->reset_x_origin (x.first / _x_scale + _start); double const nx = ( @@ -694,7 +706,7 @@ EditorSummary::set_editor_y (double const y) * @param y new editor range in summary coodinates. */ void -EditorSummary::set_editor_y (pair<double, double> const & y) +EditorSummary::set_editor_y (pair<double, double> const y) { /* Compute current height of tracks between y.first and y.second. We add up the total height into `total_height' and the height of complete tracks into |