# HG changeset patch # User Sebastien Jodogne # Date 1606320467 -3600 # Node ID f7b178ae7c08b05ec701d6ba91fc86155dbea616 # Parent fad38c4525f902b04863c74881ccd8b457efc7a8# Parent c14dd6e11ddd90fbdfa92ca9d688ecf949bac5ef merge diff -r fad38c4525f9 -r f7b178ae7c08 Applications/Platforms/WebAssembly/WebAssemblyViewport.cpp --- 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()