aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library_sdl.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index a0689343..857ab7d4 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -786,6 +786,14 @@ var LibrarySDL = {
['mousedown', 'mouseup', 'mousemove', 'DOMMouseScroll', 'mousewheel', 'mouseout'].forEach(function(event) {
Module['canvas'].addEventListener(event, SDL.receiveEvent, true);
});
+
+ // (0,0) means 'use fullscreen' in native; in Emscripten, use the current canvas size.
+ if (width == 0 && height == 0) {
+ var canvas = Module['canvas'];
+ width = canvas.width;
+ height = canvas.height;
+ }
+
Browser.setCanvasSize(width, height, true);
// Free the old surface first.
if (SDL.screen) {