diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b65069..5511b9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.25) -set(BLT_GRAPHICS_VERSION 0.12.0) +set(BLT_GRAPHICS_VERSION 0.12.1) set(BLT_GRAPHICS_TEST_VERSION 0.0.1) project(BLT_WITH_GRAPHICS VERSION ${BLT_GRAPHICS_VERSION}) diff --git a/src/blt/gfx/window.cpp b/src/blt/gfx/window.cpp index fa6eb8f..dcec8d7 100644 --- a/src/blt/gfx/window.cpp +++ b/src/blt/gfx/window.cpp @@ -189,8 +189,8 @@ namespace blt::gfx EM_BOOL emscripten_resize_callback(int, const EmscriptenUiEvent* event, void* data) { - int width = event->windowInnerWidth; - int height = event->windowInnerHeight; + int width = event->documentBodyClientWidth; + int height = event->documentBodyClientHeight; glfwSetWindowSize(window_state.window, width, height); @@ -198,11 +198,11 @@ namespace blt::gfx } EM_JS(int, get_screen_width, (), { - return window.innerWidth; + return document.body.clientWidth; }); EM_JS(int, get_screen_height, (), { - return window.innerHeight; + return document.body.clientHeight; }); #endif