changeset 1577:e8a120dd05bd

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 Sep 2020 16:51:14 +0200
parents 92fca2b3ba3d
children 1f812f4c95be
files OrthancStone/Sources/Viewport/IViewport.h OrthancStone/Sources/Viewport/WebAssemblyViewport.cpp OrthancStone/Sources/Viewport/WebAssemblyViewport.h
diffstat 3 files changed, 17 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancStone/Sources/Viewport/IViewport.h	Thu Sep 24 16:40:30 2020 +0200
+++ b/OrthancStone/Sources/Viewport/IViewport.h	Thu Sep 24 16:51:14 2020 +0200
@@ -66,8 +66,11 @@
 
       /**
        * This function must be called when the layout has changed, and
-       * thus the size of the canvas must be re-computed. Avoid
-       * calling this method too often for performance.
+       * thus the size of the canvas must be re-computed. After a call
+       * to this method, the canvas size can be accessed through
+       * "GetCompositor().GetCanvasWidth()" and
+       * "GetCompositor().GetCanvasHeight()". Avoid calling this
+       * method too often for performance.
        **/
       virtual void RefreshCanvasSize() = 0;
     };   
--- a/OrthancStone/Sources/Viewport/WebAssemblyViewport.cpp	Thu Sep 24 16:40:30 2020 +0200
+++ b/OrthancStone/Sources/Viewport/WebAssemblyViewport.cpp	Thu Sep 24 16:51:14 2020 +0200
@@ -318,11 +318,6 @@
     }
   }
 
-  void WebAssemblyViewport::UpdateCanvasSize()
-  {
-    RefreshCanvasSize();
-  }
-
   WebAssemblyViewport::~WebAssemblyViewport()
   {
     emscripten_set_resize_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW,
--- a/OrthancStone/Sources/Viewport/WebAssemblyViewport.h	Thu Sep 24 16:40:30 2020 +0200
+++ b/OrthancStone/Sources/Viewport/WebAssemblyViewport.h	Thu Sep 24 16:51:14 2020 +0200
@@ -98,13 +98,23 @@
 
     void PostConstructor();
 
+    void RefreshCanvasSize();
+
+    unsigned int GetCanvasWidth() const
+    {
+      return canvasWidth_;
+    }
+    
+    unsigned int GetCanvasHeight()
+    {
+      return canvasHeight_;
+    }
+
   public:
     virtual ILock* Lock() ORTHANC_OVERRIDE;
 
     ~WebAssemblyViewport();
 
-    virtual void UpdateCanvasSize();
-
     /**
     This method takes ownership
     */
@@ -124,19 +134,6 @@
       return canvasCssSelector_;
     }
 
-
-    void RefreshCanvasSize();
-
-    unsigned int GetCanvasWidth() const
-    {
-      return canvasWidth_;
-    }
-    
-    unsigned int GetCanvasHeight()
-    {
-      return canvasHeight_;
-    }
-    
     void FitForPrint();  // TODO - REMOVE
   };
 }