changeset 717:137d3ff48f73 tonioni

Suppress vertical scale when there are no points (scale looks absurd without sensible range)
author Chris Cannam
date Fri, 10 Jan 2014 14:41:38 +0000
parents 67b167bb60ab
children e5f4385615ac 5f9c0147d1d6
files layer/FlexiNoteLayer.cpp layer/NoteLayer.cpp layer/RegionLayer.cpp layer/TimeValueLayer.cpp
diffstat 4 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp	Fri Jan 10 14:17:50 2014 +0000
+++ b/layer/FlexiNoteLayer.cpp	Fri Jan 10 14:41:38 2014 +0000
@@ -893,7 +893,7 @@
 void
 FlexiNoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const
 {
-    if (!m_model) return;
+    if (!m_model || m_model->getPoints().empty()) return;
 
     QString unit;
     float min, max;
--- a/layer/NoteLayer.cpp	Fri Jan 10 14:17:50 2014 +0000
+++ b/layer/NoteLayer.cpp	Fri Jan 10 14:41:38 2014 +0000
@@ -842,7 +842,7 @@
 void
 NoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const
 {
-    if (!m_model) return;
+    if (!m_model || m_model->getPoints().empty()) return;
 
     QString unit;
     float min, max;
--- a/layer/RegionLayer.cpp	Fri Jan 10 14:17:50 2014 +0000
+++ b/layer/RegionLayer.cpp	Fri Jan 10 14:41:38 2014 +0000
@@ -1069,7 +1069,7 @@
 void
 RegionLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const
 {
-    if (!m_model) return;
+    if (!m_model || m_model->getPoints().empty()) return;
 
     QString unit;
     float min, max;
--- a/layer/TimeValueLayer.cpp	Fri Jan 10 14:17:50 2014 +0000
+++ b/layer/TimeValueLayer.cpp	Fri Jan 10 14:41:38 2014 +0000
@@ -1230,7 +1230,7 @@
 void
 TimeValueLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const
 {
-    if (!m_model) return;
+    if (!m_model || m_model->getPoints().empty()) return;
 
     QString unit;
     float min, max;