web: Prevent canvas flickering when resizing browser window
This commit is contained in:
parent
99ba47a554
commit
144d8d8ed4
2
.github/workflows/build_web.yml
vendored
2
.github/workflows/build_web.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: cache
|
||||
key: ${{ runner.os }}-cmakecache-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
key: web-cmakecache-${{ hashFiles('**/CMakeLists.txt') }}
|
||||
|
||||
- name: 🐳 Inject /cache into docker
|
||||
uses: reproducible-containers/buildkit-cache-dance@v2.1.2
|
||||
|
6
dist/web/source/wasm-config.js
vendored
6
dist/web/source/wasm-config.js
vendored
@ -73,4 +73,10 @@ function js_resizeCanvas() {
|
||||
canvas.height = Math.min(document.documentElement.clientHeight, window.innerHeight || 0);
|
||||
|
||||
canvas.classList.add("canvas_full_screen")
|
||||
|
||||
if (GLFW.active && GLFW.active.windowPosFunc) {
|
||||
getWasmTableEntry(GLFW.active.windowPosFunc)(GLFW.active.id, GLFW.active.x, GLFW.active.y);
|
||||
}
|
||||
|
||||
GLFW.onWindowSizeChanged();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user