diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-03-15 11:52:28 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-03-15 12:13:03 -0500 |
commit | 26ba494083c5a7417177733fa049ca1830271dc7 (patch) | |
tree | c4f92be15affb611d51ca88bf863fa17e8946eba /gtk2_ardour/editor_summary.cc | |
parent | 135e865302b5cd20a6cb0a0a4aaa682f839ffe67 (diff) |
prevent single-axis drags in the editor summary from affecting the other axis.
In theory, the EditorSummary::get_editor()/set_editor() calls
should be no-ops if the values are just passed between them,
but this turns out to be not precisely the case. Rather than
figure out exactly how ensure that this is true, mark the
new rect boundaries for the non-moving axis with -1 so that
we know to leave it alone
Diffstat (limited to 'gtk2_ardour/editor_summary.cc')
-rw-r--r-- | gtk2_ardour/editor_summary.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 479ab1319c..1ed9af974e 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -639,12 +639,16 @@ EditorSummary::on_motion_notify_event (GdkEventMotion* ev) xr.first += dx; } else if (_zoom_position == RIGHT || _zoom_position == RIGHT_TOP || _zoom_position == RIGHT_BOTTOM) { xr.second += dx; + } else { + xr.first = -1; /* do not change */ } if (_zoom_position == TOP || _zoom_position == LEFT_TOP || _zoom_position == RIGHT_TOP) { yr.first += dy; } else if (_zoom_position == BOTTOM || _zoom_position == LEFT_BOTTOM || _zoom_position == RIGHT_BOTTOM) { yr.second += dy; + } else { + yr.first = -1; /* do not change y */ } set_overlays_dirty (); @@ -799,8 +803,12 @@ EditorSummary::set_editor (pair<double,double> const x, pair<double, double> con return; } - set_editor_x (x); - set_editor_y (y); + if (x.first >= 0) { + set_editor_x (x); + } + if (y.first >= 0) { + set_editor_y (y); + } } /** Set the left of the x range visible in the editor. @@ -904,7 +912,7 @@ EditorSummary::set_editor_y (pair<double, double> const y) set_dirty (); return; } - + /* 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 `scale height'. @@ -946,7 +954,7 @@ EditorSummary::set_editor_y (pair<double, double> const y) /* Height that we will use for scaling; use the whole editor height unless there are not enough tracks to fill it. */ - double const ch = min (total_height, _editor->visible_canvas_height()); + double const ch = min (total_height, (_editor->visible_canvas_height() - _editor->get_trackview_group()->canvas_origin().y)); /* hence required scale factor of the complete tracks to fit the required y range; the amount of space they should take up divided by the amount they currently take up. |