diff layer/TimeValueLayer.cpp @ 445:4a14499fb184

* Save & reload vertical scale extents from note, time/value & colour 3d plot layers * Fix display of vertical scale in zoomed colour 3d plot layer
author Chris Cannam
date Wed, 12 Nov 2008 15:51:41 +0000
parents 681542f0c8c5
children 747a58d45d56
line wrap: on
line diff
--- a/layer/TimeValueLayer.cpp	Wed Nov 12 15:17:16 2008 +0000
+++ b/layer/TimeValueLayer.cpp	Wed Nov 12 15:51:41 2008 +0000
@@ -1616,10 +1616,12 @@
 {
     SingleColourLayer::toXml(stream, indent,
                              extraAttributes +
-                             QString(" colourMap=\"%1\" plotStyle=\"%2\" verticalScale=\"%3\"")
+                             QString(" colourMap=\"%1\" plotStyle=\"%2\" verticalScale=\"%3\" scaleMinimum=\"%4\" scaleMaximum=\"%5\" ")
                              .arg(m_colourMap)
                              .arg(m_plotStyle)
-                             .arg(m_verticalScale));
+                             .arg(m_verticalScale)
+                             .arg(m_scaleMinimum)
+                             .arg(m_scaleMaximum));
 }
 
 void
@@ -1627,7 +1629,7 @@
 {
     SingleColourLayer::setProperties(attributes);
 
-    bool ok;
+    bool ok, alsoOk;
 
     int cmap = attributes.value("colourMap").toInt(&ok);
     if (ok) setFillColourMap(cmap);
@@ -1639,5 +1641,9 @@
     VerticalScale scale = (VerticalScale)
 	attributes.value("verticalScale").toInt(&ok);
     if (ok) setVerticalScale(scale);
+
+    float min = attributes.value("scaleMinimum").toFloat(&ok);
+    float max = attributes.value("scaleMaximum").toFloat(&alsoOk);
+    if (ok && alsoOk) setDisplayExtents(min, max);
 }