mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
[JS] Check canvas size each loop, force redraw.
Fix compatibility issues, achieve smoother resizing.
This commit is contained in:
parent
a1c4c1d318
commit
07d4513886
3 changed files with 26 additions and 0 deletions
|
@ -47,6 +47,10 @@ void exit_callback() {
|
|||
}
|
||||
|
||||
void main_loop_callback() {
|
||||
bool force_draw = DisplayServerJavaScript::get_singleton()->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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue