|
@@ -747,8 +747,8 @@ var BABYLON;
|
|
|
* @param {number} [requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used.
|
|
|
*/
|
|
|
Engine.prototype.setViewport = function (viewport, requiredWidth, requiredHeight) {
|
|
|
- var width = requiredWidth || this._renderingCanvas.width;
|
|
|
- var height = requiredHeight || this._renderingCanvas.height;
|
|
|
+ var width = requiredWidth || (navigator.isCocoonJS ? window.innerWidth : this._renderingCanvas.width);
|
|
|
+ var height = requiredHeight || (navigator.isCocoonJS ? window.innerHeight : this._renderingCanvas.height);
|
|
|
var x = viewport.x || 0;
|
|
|
var y = viewport.y || 0;
|
|
|
this._cachedViewport = viewport;
|
|
@@ -772,7 +772,9 @@ var BABYLON;
|
|
|
* });
|
|
|
*/
|
|
|
Engine.prototype.resize = function () {
|
|
|
- this.setSize(this._renderingCanvas.clientWidth / this._hardwareScalingLevel, this._renderingCanvas.clientHeight / this._hardwareScalingLevel);
|
|
|
+ var width = navigator.isCocoonJS ? window.innerWidth : this._renderingCanvas.clientWidth;
|
|
|
+ var height = navigator.isCocoonJS ? window.innerHeight : this._renderingCanvas.clientHeight;
|
|
|
+ this.setSize(width / this._hardwareScalingLevel, height / this._hardwareScalingLevel);
|
|
|
};
|
|
|
/**
|
|
|
* force a specific size of the canvas
|
|
@@ -1895,4 +1897,5 @@ var BABYLON;
|
|
|
})();
|
|
|
BABYLON.Engine = Engine;
|
|
|
})(BABYLON || (BABYLON = {}));
|
|
|
+
|
|
|
//# sourceMappingURL=babylon.engine.js.map
|