# HG changeset patch # User Chris Cannam # Date 1389364898 0 # Node ID 137d3ff48f73b9a6bac722491e8628f1721b8f3d # Parent 67b167bb60abdd16d3db843197fc99d38c1e8404 Suppress vertical scale when there are no points (scale looks absurd without sensible range) diff -r 67b167bb60ab -r 137d3ff48f73 layer/FlexiNoteLayer.cpp --- 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; diff -r 67b167bb60ab -r 137d3ff48f73 layer/NoteLayer.cpp --- 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; diff -r 67b167bb60ab -r 137d3ff48f73 layer/RegionLayer.cpp --- 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; diff -r 67b167bb60ab -r 137d3ff48f73 layer/TimeValueLayer.cpp --- 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;