changeset 997:d6b83ee3a950

fix WebAssemblyOpenGLViewport::UpdateSize()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 20 Sep 2019 10:16:55 +0200
parents 727f2007ca23
children 4fda090b016b
files Framework/OpenGL/WebAssemblyOpenGLContext.cpp Framework/Viewport/WebAssemblyViewport.cpp
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/OpenGL/WebAssemblyOpenGLContext.cpp	Thu Sep 19 18:26:11 2019 +0200
+++ b/Framework/OpenGL/WebAssemblyOpenGLContext.cpp	Fri Sep 20 10:16:55 2019 +0200
@@ -189,7 +189,7 @@
           canvasWidth_ = static_cast<unsigned int>(boost::math::iround(w));
           canvasHeight_ = static_cast<unsigned int>(boost::math::iround(h));
         }
-    
+        
         emscripten_set_canvas_element_size(canvas_.c_str(), canvasWidth_, canvasHeight_);
       }
     };
--- a/Framework/Viewport/WebAssemblyViewport.cpp	Thu Sep 19 18:26:11 2019 +0200
+++ b/Framework/Viewport/WebAssemblyViewport.cpp	Fri Sep 20 10:16:55 2019 +0200
@@ -43,9 +43,12 @@
 
   void WebAssemblyOpenGLViewport::UpdateSize()
   {
-    if(compositor_.get() != NULL)
+    context_.UpdateSize();  // First read the size of the canvas
+
+    if (compositor_.get() != NULL)
+    {
       compositor_->Refresh();  // Then refresh the content of the canvas
-    context_.UpdateSize();  // First read the size of the canvas
+    }
   }
 
   /*