From 26ba494083c5a7417177733fa049ca1830271dc7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 15 Mar 2015 11:52:28 -0500 Subject: [PATCH] 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 --- gtk2_ardour/editor_summary.cc | 16 ++++++++++++---- 1 file 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 const x, pair 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 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 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.