From f7bca3b1b1d9c2888a4e488139ed6dbaaa945b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Fri, 23 Jun 2023 20:00:11 +0200 Subject: [PATCH] Emscripten: Attempt to scroll canvas into view --- src/PowderToySDLEmscripten.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/PowderToySDLEmscripten.cpp b/src/PowderToySDLEmscripten.cpp index 37a94fb7f..056c0ea87 100644 --- a/src/PowderToySDLEmscripten.cpp +++ b/src/PowderToySDLEmscripten.cpp @@ -44,4 +44,10 @@ void MainLoop() { SetFpsLimit(ui::Engine::Ref().GetFpsLimit()); MainLoopBody(); + EM_ASM({ + let canvas = document.querySelector("canvas.emscripten"); + if (canvas) { + canvas.scrollIntoView(true); + } + }); }