From 6b753c1d634c6e67714c27874d8226edc07a0e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 2 Nov 2024 19:53:29 +0100 Subject: [PATCH] Fix scaling issue in touch control layout screen, thanks @iota97 See #19573 --- UI/TouchControlLayoutScreen.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UI/TouchControlLayoutScreen.cpp b/UI/TouchControlLayoutScreen.cpp index 16329dbd9b7c..750e8c421d80 100644 --- a/UI/TouchControlLayoutScreen.cpp +++ b/UI/TouchControlLayoutScreen.cpp @@ -261,7 +261,7 @@ class PSPDPadButtons : public DragDropButton { dc.Draw()->DrawImageRotated(dirImage, x, y, scale_, angle + PI, colorBg, false); dc.Draw()->DrawImageRotated(ImageID("I_ARROW"), x2, y2, scale_, angle + PI, color); } - scale_ = theScale_/layoutAreaScale; + scale_ = theScale_ / layoutAreaScale; } void GetContentDimensions(const UIContext &dc, float &w, float &h) const override { @@ -284,6 +284,8 @@ class PSPStickDragDrop : public DragDropButton { } void Draw(UIContext &dc) override { + scale_ = theScale_ * layoutAreaScale; + float opacity = GamepadGetOpacity(); uint32_t colorBg = colorAlpha(GetButtonColor(), opacity); @@ -292,6 +294,8 @@ class PSPStickDragDrop : public DragDropButton { dc.Draw()->DrawImage(stickBg, bounds_.centerX(), bounds_.centerY(), scale_, colorBg, ALIGN_CENTER); dc.Draw()->DrawImage(stickImage, bounds_.centerX(), bounds_.centerY(), scale_ * spacing_, colorBg, ALIGN_CENTER); + + scale_ = theScale_ / layoutAreaScale; } float GetSpacing() const override { return spacing_ * 3; }