From b8da7d196c23a1ad153af7b00e641f5c2573f2c0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 10 Nov 2010 21:56:32 +0000 Subject: [PATCH] Modified version of Lincoln's patch to stop the summary causing very low track heights. Fixes #3527. git-svn-id: svn://localhost/ardour2/branches/3.0@7994 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_summary.cc | 12 +++++++++--- gtk2_ardour/time_axis_view.cc | 6 +++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index b75f228c52..423b137cd8 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -26,6 +26,7 @@ #include "region_view.h" #include "rgb_macros.h" #include "keyboard.h" +#include "editor_routes.h" using namespace std; using namespace ARDOUR; @@ -666,12 +667,15 @@ EditorSummary::set_editor_y (pair const & y) pair yc = y; double total_height = 0; double scale_height = 0; + + _editor->_routes->suspend_redisplay (); + for (TrackViewList::const_iterator i = _editor->track_views.begin(); i != _editor->track_views.end(); ++i) { if ((*i)->hidden()) { continue; } - + double const h = (*i)->effective_height (); if (yc.first >= 0 && yc.first < _track_height) { @@ -687,7 +691,7 @@ EditorSummary::set_editor_y (pair const & y) yc.first -= _track_height; yc.second -= _track_height; } - + /* hence required scale factor of the complete tracks to fit the required y range */ double const scale = ((_editor->canvas_height() - _editor->get_canvas_timebars_vsize()) - (total_height - scale_height)) / scale_height; @@ -702,13 +706,15 @@ EditorSummary::set_editor_y (pair const & y) } if (yc.first < 0 && yc.second > _track_height) { - (*i)->set_height ((*i)->effective_height() * scale); + (*i)->set_height (max (TimeAxisView::preset_height (HeightSmall), (uint32_t) ((*i)->effective_height() * scale))); } yc.first -= _track_height; yc.second -= _track_height; } + _editor->_routes->resume_redisplay (); + set_editor_y (y.first); } diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 6d297ef14e..2022783928 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -427,8 +427,12 @@ TimeAxisView::set_height (Height h) } void -TimeAxisView::set_height(uint32_t h) +TimeAxisView::set_height (uint32_t h) { + if (h < preset_height (HeightSmall)) { + h = preset_height (HeightSmall); + } + time_axis_vbox.property_height_request () = h; height = h;