diff layer/NoteLayer.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/NoteLayer.cpp	Wed Nov 12 15:17:16 2008 +0000
+++ b/layer/NoteLayer.cpp	Wed Nov 12 15:51:41 2008 +0000
@@ -1170,8 +1170,10 @@
                  QString indent, QString extraAttributes) const
 {
     SingleColourLayer::toXml(stream, indent, extraAttributes +
-                             QString(" verticalScale=\"%1\"")
-                             .arg(m_verticalScale));
+                             QString(" verticalScale=\"%1\" scaleMinimum=\"%2\" scaleMaximum=\"%3\" ")
+                             .arg(m_verticalScale)
+                             .arg(m_scaleMinimum)
+                             .arg(m_scaleMaximum));
 }
 
 void
@@ -1179,10 +1181,14 @@
 {
     SingleColourLayer::setProperties(attributes);
 
-    bool ok;
+    bool ok, alsoOk;
     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);
 }