Mercurial > hg > orthanc-stone
changeset 1688:c14dd6e11ddd
merge
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 25 Nov 2020 17:03:08 +0100 |
parents | cc5a2e076746 (diff) 59fc37c10cfa (current diff) |
children | f7b178ae7c08 |
files | |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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()