From 2383e7211599f4e6944f3067f1aaac3c53f7a796 Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Fri, 16 Jul 2021 22:34:14 +0530 Subject: [PATCH] fix zoom shit again --- src/Main.hx | 4 ++++ src/Settings.hx | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/Main.hx b/src/Main.hx index 7aef833e..b953255a 100644 --- a/src/Main.hx +++ b/src/Main.hx @@ -26,6 +26,10 @@ class Main extends hxd.App { #if hl hl.UI.closeConsole(); #end + #if js + var zoomRatio = js.Browser.window.devicePixelRatio; + s2d.scaleMode = Zoom(zoomRatio); + #end ResourceLoader.init(s2d, () -> { Settings.init(); AudioManager.init(); diff --git a/src/Settings.hx b/src/Settings.hx index ec89d661..968a704e 100644 --- a/src/Settings.hx +++ b/src/Settings.hx @@ -193,6 +193,9 @@ class Settings { Window.getInstance().resize(optionsSettings.screenWidth, optionsSettings.screenHeight); Window.getInstance().displayMode = optionsSettings.isFullScreen ? FullscreenResize : Windowed; #end + #if js + Window.getInstance().propagateKeyEvents = true; + #end // @:privateAccess Window.getInstance().window.center(); Window.getInstance().addResizeEvent(() -> { var wnd = Window.getInstance();