From e8ca33ab8af1b27ddf1388307e44edb560749dbe Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Tue, 16 Jan 2018 12:41:31 +0100 Subject: [PATCH] fix screen avail width / height --- src/game-lib-d3-api-camera.js | 2 +- src/game-lib-system-render.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game-lib-d3-api-camera.js b/src/game-lib-d3-api-camera.js index 0b520a8..e01b175 100644 --- a/src/game-lib-d3-api-camera.js +++ b/src/game-lib-d3-api-camera.js @@ -68,7 +68,7 @@ GameLib.D3.API.Camera = function( this.fov = fov; if (GameLib.Utils.UndefinedOrNull(aspect)) { - aspect = window.innerWidth / window.innerHeight; + aspect = window.screen.availWidth / window.screen.availHeight; } this.aspect = aspect; diff --git a/src/game-lib-system-render.js b/src/game-lib-system-render.js index 15855b0..088331e 100644 --- a/src/game-lib-system-render.js +++ b/src/game-lib-system-render.js @@ -73,8 +73,8 @@ GameLib.System.Render.prototype.start = function() { GameLib.Event.Emit( GameLib.Event.WINDOW_RESIZE, { - width : window.innerWidth, - height : window.innerHeight + width : window.screen.availWidth, + height : window.screen.availHeight } ); @@ -101,8 +101,8 @@ GameLib.System.Render.prototype.nativeWindowResize = function() { GameLib.Event.Emit( GameLib.Event.WINDOW_RESIZE, { - width : window.innerWidth, - height : window.innerHeight + width : window.screen.availWidth, + height : window.screen.availHeight } ); };