changeset 1925:a7a77488ddb1

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Mar 2022 14:21:22 +0100
parents f4050908c6bc
children 8efcff08f868
files Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp OrthancStone/Sources/Viewport/DefaultViewportInteractor.cpp TODO
diffstat 3 files changed, 29 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Wed Mar 23 12:24:35 2022 +0100
+++ b/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp	Wed Mar 23 14:21:22 2022 +0100
@@ -2447,6 +2447,7 @@
         layer.SetFlipY(flipY_);
       }
 
+      if (lock->GetController().GetScene().HasLayer(LAYER_OVERLAY))
       {
         OrthancStone::TextureBaseSceneLayer& layer = 
           dynamic_cast<OrthancStone::TextureBaseSceneLayer&>(
--- a/OrthancStone/Sources/Viewport/DefaultViewportInteractor.cpp	Wed Mar 23 12:24:35 2022 +0100
+++ b/OrthancStone/Sources/Viewport/DefaultViewportInteractor.cpp	Wed Mar 23 14:21:22 2022 +0100
@@ -26,6 +26,7 @@
 #include "../Scene2D/PanSceneTracker.h"
 #include "../Scene2D/RotateSceneTracker.h"
 #include "../Scene2D/ZoomSceneTracker.h"
+#include "../Scene2DViewport/ViewportController.h"
 
 #include <OrthancException.h>
 
@@ -47,8 +48,28 @@
         return new RotateSceneTracker(viewport, event);
 
       case MouseAction_GrayscaleWindowing:
-        return new GrayscaleWindowingSceneTracker(
-          viewport, windowingLayer_, event, viewportWidth, viewportHeight);
+      {
+        boost::shared_ptr<IViewport> v(viewport.lock());
+        if (v == NULL)
+        {
+          return NULL;
+        }
+        else
+        {
+          std::unique_ptr<IViewport::ILock> lock(v->Lock());
+          if (lock->GetController().GetScene().HasLayer(windowingLayer_) &&
+              lock->GetController().GetScene().GetLayer(windowingLayer_).GetType() == ISceneLayer::Type_FloatTexture)
+          {
+            return new GrayscaleWindowingSceneTracker(
+              viewport, windowingLayer_, event, viewportWidth, viewportHeight);
+          }
+          else
+          {
+            // Don't create the tracker if the layer is not a float texture
+            return NULL;
+          }
+        }
+      }
 
       case MouseAction_Pan:
         return new PanSceneTracker(viewport, event);
--- a/TODO	Wed Mar 23 12:24:35 2022 +0100
+++ b/TODO	Wed Mar 23 14:21:22 2022 +0100
@@ -33,6 +33,11 @@
 * When opening a CT with 700 slices, if you drop the thumbnail in the viewport
   before the studies/../metadata have been loaded, the series will never be displayed
 
+* Compatibility with Google Chrome browser on iPad Air 4:
+  https://groups.google.com/g/orthanc-users/c/7SgedbIiA2k/
+  https://groups.google.com/g/orthanc-users/c/RfQJFgkOUYY/m/za7rkcLNBQAJ
+
+
 -----------------
 Code refactorings
 -----------------