summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_summary.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-05-09 20:48:21 +0000
committerCarl Hetherington <carl@carlh.net>2010-05-09 20:48:21 +0000
commit792e3de1d4cb291a02c5c31dad54028049bafed9 (patch)
treee65183deeb01752110a59a5b834e06deef811dab /gtk2_ardour/editor_summary.cc
parentacfc44f3889704587ff281c6348523b2811e7c2e (diff)
Create the session range location as and when the session first gets some content. Allows both the beginning and end of the range to expand to contain the actual session contents.
git-svn-id: svn://localhost/ardour2/branches/3.0@7087 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_summary.cc')
-rw-r--r--gtk2_ardour/editor_summary.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc
index fd4422bc08..5c2135ac43 100644
--- a/gtk2_ardour/editor_summary.cc
+++ b/gtk2_ardour/editor_summary.cc
@@ -153,7 +153,11 @@ EditorSummary::render (cairo_t* cr)
max_height = max (max_height, t);
}
- _x_scale = static_cast<double> (_width) / (_end - _start);
+ if (_end != _start) {
+ _x_scale = static_cast<double> (_width) / (_end - _start);
+ } else {
+ _x_scale = 1;
+ }
_y_scale = static_cast<double> (_height) / h;
/* tallest a region should ever be in the summary, in pixels */