Skip to content

Commit

Permalink
web: Prevent canvas flickering when resizing browser window
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Dec 27, 2023
1 parent 99ba47a commit 144d8d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions dist/web/source/wasm-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit 144d8d8

Please sign in to comment.