# HG changeset patch
# User Chris Cannam
# Date 1560434725 -3600
# Node ID f9110e5afca14aea25793d4f9900d76abf06f7c4
# Parent  0ecfaa463c1b11cbbe2070de5dbaf73bcd9c0bc5
Don't try to draw scale from a dormant layer!

diff -r 0ecfaa463c1b -r f9110e5afca1 view/Pane.cpp
--- 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)) {