From 310642361849c0a85962a10bdf7feb57c07116ba Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Fri, 23 Dec 2022 19:16:33 +0530 Subject: [PATCH] better scaling --- src/Main.hx | 8 ++++---- src/Settings.hx | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Main.hx b/src/Main.hx index 26e76fee..5afa4da3 100644 --- a/src/Main.hx +++ b/src/Main.hx @@ -40,10 +40,10 @@ class Main extends hxd.App { 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); #end - // #if android - // var zoomRatio = Window.getInstance().height / 768; - // s2d.scaleMode = Zoom(zoomRatio); - // #end + #if android + var zoomRatio = Window.getInstance().height / 768; + s2d.scaleMode = Zoom(zoomRatio); + #end #if android Window.getInstance().addEventTarget(ev -> { diff --git a/src/Settings.hx b/src/Settings.hx index 4f2af9ec..f79f7cda 100644 --- a/src/Settings.hx +++ b/src/Settings.hx @@ -408,7 +408,6 @@ class Settings { #if hl Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight); Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed; - uiScale = 1 / Window.getInstance().windowToPixelRatio; #end #if js Window.getInstance().propagateKeyEvents = true; @@ -421,10 +420,10 @@ class Settings { var zoomRatio = Util.isTouchDevice() ? js.Browser.window.screen.height * js.Browser.window.devicePixelRatio / 768 : js.Browser.window.devicePixelRatio; // 768 / js.Browser.window.innerHeight; // js.Browser.window.innerHeight * js.Browser.window.devicePixelRatio / 768; Settings.zoomRatio = zoomRatio; #end - // #if android - // var zoomRatio = Window.getInstance().height / 768; - // Settings.zoomRatio = zoomRatio; - // #end + #if android + var zoomRatio = Window.getInstance().height / 768; + Settings.zoomRatio = zoomRatio; + #end #if hl Settings.optionsSettings.screenWidth = cast wnd.width; Settings.optionsSettings.screenHeight = cast wnd.height;