mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-27 05:01:38 +00:00
fix js scaling on startup
This commit is contained in:
parent
88cf03f3b5
commit
2b549ff328
1 changed files with 6 additions and 0 deletions
|
|
@ -51,6 +51,12 @@ class Main extends hxd.App {
|
||||||
#if js
|
#if js
|
||||||
var zoomRatio = Util.isTouchDevice() ? js.Browser.window.screen.height * js.Browser.window.devicePixelRatio / 768 : js.Browser.window.devicePixelRatio; // js.Browser.window.devicePixelRatio;
|
var zoomRatio = Util.isTouchDevice() ? js.Browser.window.screen.height * js.Browser.window.devicePixelRatio / 768 : js.Browser.window.devicePixelRatio; // js.Browser.window.devicePixelRatio;
|
||||||
s2d.scaleMode = Zoom(zoomRatio);
|
s2d.scaleMode = Zoom(zoomRatio);
|
||||||
|
Settings.zoomRatio = zoomRatio;
|
||||||
|
Settings.optionsSettings.screenWidth = cast js.Browser.window.screen.width; // 1024; // cast(js.Browser.window.innerWidth / js.Browser.window.innerHeight) * 768; // cast js.Browser.window.innerWidth * js.Browser.window.devicePixelRatio * 0.5;
|
||||||
|
Settings.optionsSettings.screenHeight = cast js.Browser.window.screen.height; // 768; // cast js.Browser.window.innerHeight * js.Browser.window.devicePixelRatio * 0.5;
|
||||||
|
var canvasElement = js.Browser.document.getElementById("webgl");
|
||||||
|
canvasElement.style.width = "100%";
|
||||||
|
canvasElement.style.height = "100%";
|
||||||
#end
|
#end
|
||||||
#if android
|
#if android
|
||||||
var zoomRatio = Window.getInstance().height / 600;
|
var zoomRatio = Window.getInstance().height / 600;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue