diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-01-24 08:30:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-24 08:30:43 +0100 |
commit | 5ff8d4b07d22e3164894fd1e886e339b024c1a35 (patch) | |
tree | 67638afcfb1f96dabcd85d1f04d241f5dec6f49e /platform | |
parent | fb56315ea20bad73f1169e86a1c213bcdc0be08b (diff) | |
parent | dcc55bad20e8538819e3daac4a23ba9d05d25bcd (diff) |
Merge pull request #16019 from eska014/html5-fix-no-resize-on-start
Fix HTML5 JS API setResizeCanvasOnStart
Diffstat (limited to 'platform')
-rw-r--r-- | platform/javascript/os_javascript.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 3590c30579..e226ab6332 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -430,16 +430,11 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, // can't fulfil fullscreen request due to browser security video_mode.fullscreen = false; /* clang-format off */ - bool resize_canvas_on_start = EM_ASM_INT_V( - return Module.resizeCanvasOnStart; - ); - /* clang-format on */ - if (resize_canvas_on_start) { + if (EM_ASM_INT_V({ return Module.resizeCanvasOnStart })) { + /* clang-format on */ set_window_size(Size2(video_mode.width, video_mode.height)); } else { - Size2 canvas_size = get_window_size(); - video_mode.width = canvas_size.width; - video_mode.height = canvas_size.height; + set_window_size(get_window_size()); } char locale_ptr[16]; |