mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +00:00
[JS] Check canvas size each loop, force redraw.
Remove ResizeObserver, fix compatibility issues, achieve smoother resizing.
This commit is contained in:
parent
093c463ebf
commit
c7d2767ab9
3 changed files with 23 additions and 17 deletions
|
@ -59,6 +59,10 @@ void exit_callback() {
|
|||
|
||||
void main_loop_callback() {
|
||||
|
||||
bool force_draw = os->check_size_force_redraw();
|
||||
if (force_draw) {
|
||||
Main::force_redraw();
|
||||
}
|
||||
if (os->main_loop_iterate()) {
|
||||
emscripten_cancel_main_loop(); // Cancel current loop and wait for finalize_async.
|
||||
EM_ASM({
|
||||
|
@ -106,7 +110,6 @@ extern "C" EMSCRIPTEN_KEEPALIVE void main_after_fs_sync(char *p_idbfs_err) {
|
|||
EM_ASM({
|
||||
stringToUTF8(Module['locale'], $0, 16);
|
||||
}, locale_ptr);
|
||||
|
||||
/* clang-format on */
|
||||
setenv("LANG", locale_ptr, true);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue