diff --git a/profiler/build/wasm/index.html b/profiler/build/wasm/index.html index 008eebe4..13ae7fbd 100644 --- a/profiler/build/wasm/index.html +++ b/profiler/build/wasm/index.html @@ -91,7 +91,9 @@ var canvasElement = document.getElementById('canvas'); function resizeHandler() { - Module.ccall('nativeResize', 'number', ['number', 'number'], [window.innerWidth, window.innerHeight]); + Module.ccall('nativeResize', 'number', ['number', 'number'], [window.innerWidth * window.devicePixelRatio, window.innerHeight * window.devicePixelRatio]); + Module.canvas.style.width = window.innerWidth + 'px'; + Module.canvas.style.height = window.innerHeight + 'px'; } var Module = { diff --git a/profiler/src/BackendGlfw.cpp b/profiler/src/BackendGlfw.cpp index 27785c9b..952e473c 100644 --- a/profiler/src/BackendGlfw.cpp +++ b/profiler/src/BackendGlfw.cpp @@ -187,7 +187,9 @@ void Backend::SetTitle( const char* title ) float Backend::GetDpiScale() { -#if GLFW_VERSION_MAJOR > 3 || ( GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3 ) +#ifdef __EMSCRIPTEN__ + return EM_ASM_DOUBLE( { return window.devicePixelRatio; } ); +#elif GLFW_VERSION_MAJOR > 3 || ( GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3 ) auto monitor = glfwGetWindowMonitor( s_window ); if( !monitor ) monitor = glfwGetPrimaryMonitor(); if( monitor )