diff layer/Layer.cpp @ 1315:1d7921b1852f

Ensure scale appears for layer when drawn in AutoAlign mode without any other layer present to align to
author Chris Cannam
date Wed, 04 Jul 2018 15:34:16 +0100
parents a34a2a25907c
children c8a6fd3f9dff
line wrap: on
line diff
--- a/layer/Layer.cpp	Wed Jul 04 15:33:47 2018 +0100
+++ b/layer/Layer.cpp	Wed Jul 04 15:34:16 2018 +0100
@@ -588,6 +588,31 @@
     v->drawMeasurementRect(paint, this, r.pixrect.normalized(), focus);
 }
 
+bool
+Layer::valueExtentsMatchMine(LayerGeometryProvider *v) const
+{
+    double min, min_;
+    double max, max_;
+    bool logarithmic, logarithmic_;
+    QString unit;
+
+    if (!getValueExtents(min_, max_, logarithmic_, unit)) {
+        return false;
+    }
+
+    if (!v->getValueExtents(unit, min, max, logarithmic)) {
+        return false;
+    }
+
+    if (min != min_ ||
+        max != max_ ||
+        logarithmic != logarithmic_) {
+        return false;
+    }
+
+    return true;
+}
+
 void
 Layer::toXml(QTextStream &stream,
              QString indent, QString extraAttributes) const