diff Framework/Scene2D/TextSceneLayer.cpp @ 949:32eaf4929b08 toa2019081301

OrthancMultiframeVolumeLoader and OrthancSeriesVolumeProgressiveLoader now implement IGeometryProvider so that the geometry reference can be switched (CT or DOSE, for instance) + VolumeImageGeometry::SetSize renamed to VolumeImageGeometry::SetSizeInVoxels + prevent text layer update if text or properties do not change + a few stream operator<< for debug (Vector, Matrix,...) + fixed memory access aligment issues in ImageBuffer3D::ExtractSagittalSlice + fix for wrong screen Y offset of mpr slices in DicomVolumeImageMPRSlicer.
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 13 Aug 2019 16:01:05 +0200
parents 61ba4b504e9a
children 2d8ab34c8c91
line wrap: on
line diff
--- a/Framework/Scene2D/TextSceneLayer.cpp	Sat Aug 10 13:13:11 2019 +0200
+++ b/Framework/Scene2D/TextSceneLayer.cpp	Tue Aug 13 16:01:05 2019 +0200
@@ -50,32 +50,47 @@
   void TextSceneLayer::SetPosition(double x,
                                    double y)
   {
-    x_ = x;
-    y_ = y;
-    revision_ ++;
+    if (x != x_ || y != y_)
+    {
+      x_ = x;
+      y_ = y;
+      revision_++;
+    }
   }
 
   void TextSceneLayer::SetText(const std::string& utf8)
   {
-    utf8_ = utf8;
-    revision_ ++;
+    if (utf8 != utf8_)
+    {
+      utf8_ = utf8;
+      revision_++;
+    }
   }
 
   void TextSceneLayer::SetFontIndex(size_t fontIndex)
   {
-    fontIndex_ = fontIndex;
-    revision_ ++;
+    if (fontIndex != fontIndex_)
+    {
+      fontIndex_ = fontIndex;
+      revision_++;
+    }
   }
 
   void TextSceneLayer::SetAnchor(BitmapAnchor anchor)
   {
-    anchor_ = anchor;
-    revision_ ++;
+    if (anchor != anchor_)
+    {
+      anchor_ = anchor;
+      revision_++;
+    }
   }
 
   void TextSceneLayer::SetBorder(unsigned int border)
   {
-    border_ = border;
-    revision_ ++;
+    if (border != border_)
+    {
+      border_ = border;
+      revision_++;
+    }
   }
 }