diff --git a/www.eng/js/plugins/VND_CordovaFixes.js b/www.eng/js/plugins/VND_CordovaFixes.js index fca849d..8b6f77a 100644 --- a/www.eng/js/plugins/VND_CordovaFixes.js +++ b/www.eng/js/plugins/VND_CordovaFixes.js @@ -148,18 +148,16 @@ document.addEventListener("backbutton", function(event){ // ===================== document.addEventListener("deviceready", () => { - Graphics._centerElement = function (element) { - console.log("Element centered!!!"); - var width = 640 * (window.screen.height / 480); - var height = window.screen.height; - element.style.position = 'absolute'; - element.style.margin = 'auto'; - element.style.top = 0; - element.style.left = 0; - element.style.right = 0; - element.style.bottom = 0; - element.style.width = width + 'px'; - element.style.height = height + 'px'; + Graphics._updateRealScale = function () { + if (this._stretchEnabled) { + var h = window.innerWidth / this._width; + var v = window.innerHeight / this._height; + if (h >= 1 && h - 0.01 <= 1) h = 1; + if (v >= 1 && v - 0.01 <= 1) v = 1; + this._realScale = Math.min(h, v); + } else { + this._realScale = this._scale; + } }; }) diff --git a/www.rus/js/plugins/VND_CordovaFixes.js b/www.rus/js/plugins/VND_CordovaFixes.js index fca849d..8b6f77a 100644 --- a/www.rus/js/plugins/VND_CordovaFixes.js +++ b/www.rus/js/plugins/VND_CordovaFixes.js @@ -148,18 +148,16 @@ document.addEventListener("backbutton", function(event){ // ===================== document.addEventListener("deviceready", () => { - Graphics._centerElement = function (element) { - console.log("Element centered!!!"); - var width = 640 * (window.screen.height / 480); - var height = window.screen.height; - element.style.position = 'absolute'; - element.style.margin = 'auto'; - element.style.top = 0; - element.style.left = 0; - element.style.right = 0; - element.style.bottom = 0; - element.style.width = width + 'px'; - element.style.height = height + 'px'; + Graphics._updateRealScale = function () { + if (this._stretchEnabled) { + var h = window.innerWidth / this._width; + var v = window.innerHeight / this._height; + if (h >= 1 && h - 0.01 <= 1) h = 1; + if (v >= 1 && v - 0.01 <= 1) v = 1; + this._realScale = Math.min(h, v); + } else { + this._realScale = this._scale; + } }; })