# HG changeset patch # User Benjamin Golinvaux # Date 1606320188 -3600 # Node ID c14dd6e11ddd90fbdfa92ca9d688ecf949bac5ef # Parent cc5a2e076746124b3219c2fd0159d168bd4c5bbf# Parent 59fc37c10cfa1a13ef41414d427e631031fb45e3 merge diff -r 59fc37c10cfa -r c14dd6e11ddd Applications/Platforms/WebAssembly/WebAssemblyViewport.cpp --- a/Applications/Platforms/WebAssembly/WebAssemblyViewport.cpp Wed Nov 25 16:51:44 2020 +0100 +++ b/Applications/Platforms/WebAssembly/WebAssemblyViewport.cpp Wed Nov 25 17:03:08 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()