changeset 880:dd95abfe736c alignment_view

Avoid drawing a single lonesome 0 if nothing is loaded at all
author Chris Cannam
date Fri, 21 Nov 2014 11:48:21 +0000
parents 7463ece5d5e8
children 6a590241d8ad
files view/Pane.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/view/Pane.cpp	Fri Nov 14 10:19:50 2014 +0000
+++ b/view/Pane.cpp	Fri Nov 21 11:48:21 2014 +0000
@@ -716,6 +716,10 @@
 void
 Pane::drawCentreLine(int sampleRate, QPainter &paint, bool omitLine)
 {
+    if (omitLine && m_manager->getMainModelSampleRate() == 0) {
+        return;
+    }
+    
     int fontHeight = paint.fontMetrics().height();
     int fontAscent = paint.fontMetrics().ascent();