Emscripten: Attempt to scroll canvas into view

This commit is contained in:
Tamás Bálint Misius 2023-06-23 20:00:11 +02:00
parent cfd2baa064
commit f7bca3b1b1
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -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);
}
});
}