aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-02-28 12:50:02 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-02-28 12:50:02 -0800
commitcde8796577b2d1959b5322172bec85ba6b10647c (patch)
treec9ec9395f68b09758cde8264bd675ec763420865 /src
parenta5a94fb703b08363aa7c5f5256a682e1bf81f034 (diff)
fix some whitespace
Diffstat (limited to 'src')
-rw-r--r--src/library_browser.js77
1 files changed, 38 insertions, 39 deletions
diff --git a/src/library_browser.js b/src/library_browser.js
index 96945435..47b3b2f9 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -622,53 +622,52 @@ mergeInto(LibraryManager.library, {
},
updateCanvasDimensions : function(canvas, wNative, hNative) {
- if (wNative && hNative) {
- canvas.widthNative = wNative;
- canvas.heightNative = hNative;
+ if (wNative && hNative) {
+ canvas.widthNative = wNative;
+ canvas.heightNative = hNative;
+ } else {
+ wNative = canvas.widthNative;
+ hNative = canvas.heightNative;
+ }
+ var w = wNative;
+ var h = hNative;
+ if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {
+ if (w/h < Module['forcedAspectRatio']) {
+ w = Math.round(h * Module['forcedAspectRatio']);
} else {
- wNative = canvas.widthNative;
- hNative = canvas.heightNative;
- }
- var w = wNative;
- var h = hNative;
- if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {
- if (w/h < Module['forcedAspectRatio']) {
- w = Math.round(h * Module['forcedAspectRatio']);
- } else {
- h = Math.round(w / Module['forcedAspectRatio']);
- }
+ h = Math.round(w / Module['forcedAspectRatio']);
}
- if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||
- document['mozFullScreenElement'] || document['mozFullscreenElement'] ||
- document['fullScreenElement'] || document['fullscreenElement'] ||
- document['msFullScreenElement'] || document['msFullscreenElement'] ||
- document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {
- var factor = Math.min(screen.width / w, screen.height / h);
- w = Math.round(w * factor);
- h = Math.round(h * factor);
+ }
+ if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||
+ document['mozFullScreenElement'] || document['mozFullscreenElement'] ||
+ document['fullScreenElement'] || document['fullscreenElement'] ||
+ document['msFullScreenElement'] || document['msFullscreenElement'] ||
+ document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {
+ var factor = Math.min(screen.width / w, screen.height / h);
+ w = Math.round(w * factor);
+ h = Math.round(h * factor);
+ }
+ if (Browser.resizeCanvas) {
+ if (canvas.width != w) canvas.width = w;
+ if (canvas.height != h) canvas.height = h;
+ if (typeof canvas.style != 'undefined') {
+ canvas.style.removeProperty( "width");
+ canvas.style.removeProperty("height");
}
- if (Browser.resizeCanvas) {
- if (canvas.width != w) canvas.width = w;
- if (canvas.height != h) canvas.height = h;
- if (typeof canvas.style != 'undefined') {
+ } else {
+ if (canvas.width != wNative) canvas.width = wNative;
+ if (canvas.height != hNative) canvas.height = hNative;
+ if (typeof canvas.style != 'undefined') {
+ if (w != wNative || h != hNative) {
+ canvas.style.setProperty( "width", w + "px", "important");
+ canvas.style.setProperty("height", h + "px", "important");
+ } else {
canvas.style.removeProperty( "width");
canvas.style.removeProperty("height");
}
- } else {
- if (canvas.width != wNative) canvas.width = wNative;
- if (canvas.height != hNative) canvas.height = hNative;
- if (typeof canvas.style != 'undefined') {
- if (w != wNative || h != hNative) {
- canvas.style.setProperty( "width", w + "px", "important");
- canvas.style.setProperty("height", h + "px", "important");
- } else {
- canvas.style.removeProperty( "width");
- canvas.style.removeProperty("height");
- }
- }
}
}
-
+ }
},
emscripten_async_wget: function(url, file, onload, onerror) {