diff options
author | Carl Hetherington <carl@carlh.net> | 2009-06-15 01:36:46 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-06-15 01:36:46 +0000 |
commit | 22a107592e8460f0c0042f63fcffc5ba818a5922 (patch) | |
tree | 51cd69660c1ef475a7bc66543c076bfa05e60a70 /gtk2_ardour | |
parent | ea5827b51cb12a33ca910f6082675a078ae0d486 (diff) |
Put a limit on the tallest that a region can be in the summary.
git-svn-id: svn://localhost/ardour2/branches/3.0@5195 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_summary.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index c35e0a1133..4211b391a2 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -157,14 +157,24 @@ EditorSummary::render (cairo_t* cr) /* compute total height of all tracks */ int h = 0; + int max_height = 0; for (PublicEditor::TrackViewList::const_iterator i = _editor->track_views.begin(); i != _editor->track_views.end(); ++i) { - h += (*i)->effective_height (); + int const t = (*i)->effective_height (); + h += t; + max_height = max (max_height, t); } nframes_t const start = _session->current_start_frame (); _pixels_per_frame = static_cast<double> (_width) / (_session->current_end_frame() - start); _vertical_scale = static_cast<double> (_height) / h; + /* tallest a region should ever be in the summary, in pixels */ + int const tallest_region_pixels = 12; + + if (max_height * _vertical_scale > tallest_region_pixels) { + _vertical_scale = static_cast<double> (tallest_region_pixels) / max_height; + } + /* render regions */ double y = 0; |