diff Framework/Scene2D/GrayscaleStyleConfigurator.cpp @ 1209:b5dec783ba08

Fixed the style configurator to only set inversion on the image if it has been explicitely asked by the user + Fixed AddCircle in the measuring toolbox + dummy change (reindent)
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 04 Dec 2019 15:46:14 +0100
parents eb28dfe432f7
children ab06dfdf3b75 2d8ab34c8c91
line wrap: on
line diff
--- a/Framework/Scene2D/GrayscaleStyleConfigurator.cpp	Tue Dec 03 09:51:00 2019 +0100
+++ b/Framework/Scene2D/GrayscaleStyleConfigurator.cpp	Wed Dec 04 15:46:14 2019 +0100
@@ -29,7 +29,7 @@
 {
   void GrayscaleStyleConfigurator::SetWindowing(ImageWindowing windowing)
   {
-    hasWindowing_ = true;
+    hasWindowingOverride_ = true;
     windowing_ = windowing;
     revision_++;
   }
@@ -49,6 +49,7 @@
 
   void GrayscaleStyleConfigurator::SetInverted(bool inverted)
   {
+    hasInversionOverride_ = true;
     inverted_ = inverted;
     revision_++;
   }
@@ -88,7 +89,7 @@
     
     l.SetLinearInterpolation(linearInterpolation_);
 
-    if (hasWindowing_)
+    if (hasWindowingOverride_)
     {
       if (windowing_ != ImageWindowing_Custom)
       {
@@ -99,6 +100,9 @@
         l.SetCustomWindowing(customWindowCenter_, customWindowWidth_);
       }
     }
-    l.SetInverted(inverted_);
+    if (hasInversionOverride_)
+    {
+      l.SetInverted(inverted_);
+    }
   }
 }