changeset 1690:f7b178ae7c08

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 25 Nov 2020 17:07:47 +0100
parents fad38c4525f9 (current diff) c14dd6e11ddd (diff)
children 4a49de03a419
files
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Platforms/WebAssembly/WebAssemblyViewport.cpp	Wed Nov 25 17:07:32 2020 +0100
+++ b/Applications/Platforms/WebAssembly/WebAssemblyViewport.cpp	Wed Nov 25 17:07:47 2020 +0100
@@ -420,8 +420,15 @@
 
   void WebAssemblyViewport::RefreshCanvasSize()
   {
-    double w, h;
-    emscripten_get_element_css_size(GetCanvasCssSelector().c_str(), &w, &h);
+    double w = -1, h = -1;
+    EMSCRIPTEN_RESULT result = 
+      emscripten_get_element_css_size(GetCanvasCssSelector().c_str(), &w, &h);
+
+    if (result != EMSCRIPTEN_RESULT_SUCCESS)
+    {
+      LOG(WARNING) << "WebAssemblyViewport::RefreshCanvasSize failed to "
+        << "retrieve CSS size for " << GetCanvasCssSelector();
+    }
 
     /**
      * Emscripten has the function emscripten_get_element_css_size()