changeset 1467:f9110e5afca1

Don't try to draw scale from a dormant layer!
author Chris Cannam
date Thu, 13 Jun 2019 15:05:25 +0100
parents 0ecfaa463c1b
children de41a11cabc2
files view/Pane.cpp
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/view/Pane.cpp	Fri May 24 15:14:09 2019 +0100
+++ b/view/Pane.cpp	Thu Jun 13 15:05:25 2019 +0100
@@ -519,12 +519,12 @@
     bool log;
     QString unit;
 
-    // If the top layer has no scale and reports no display
-    // extents, but does report a unit, then the scale should be
-    // drawn from any underlying layer with a scale and that unit.
-    // If the top layer has no scale and no value extents at all,
-    // then the scale should be drawn from any underlying layer
-    // with a scale regardless of unit.
+    // If the top layer has no scale and reports no display extents,
+    // but does report a unit, then the scale should be drawn from any
+    // (visible) underlying layer with a scale and that unit.  If the
+    // top layer has no scale and no value extents at all, then the
+    // scale should be drawn from any (visible) underlying layer with
+    // a scale regardless of unit.
 
     int sw = topLayer->getVerticalScaleWidth
         (this, m_manager->shouldShowVerticalColourScale(), paint);
@@ -548,6 +548,7 @@
                     --vi;
                         
                     if ((*vi) == topLayer) continue;
+                    if ((*vi)->isLayerDormant(this)) continue;
                         
                     sw = (*vi)->getVerticalScaleWidth
                         (this, m_manager->shouldShowVerticalColourScale(), paint);
@@ -568,6 +569,7 @@
                     --vi;
                         
                     if ((*vi) == topLayer) continue;
+                    if ((*vi)->isLayerDormant(this)) continue;
                         
                     if ((*vi)->getDisplayExtents(min, max)) {