From 96521c51be8921e919b19059317c53465bc63b39 Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 30 Apr 2024 02:56:02 -0400 Subject: [PATCH] change to width/height --- CMakeLists.txt | 2 +- src/blt/gfx/window.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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