Skip to content

Commit 6b753c1

Browse files
committed
Fix scaling issue in touch control layout screen, thanks @iota97
See #19573
1 parent d20bde8 commit 6b753c1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

UI/TouchControlLayoutScreen.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class PSPDPadButtons : public DragDropButton {
261261
dc.Draw()->DrawImageRotated(dirImage, x, y, scale_, angle + PI, colorBg, false);
262262
dc.Draw()->DrawImageRotated(ImageID("I_ARROW"), x2, y2, scale_, angle + PI, color);
263263
}
264-
scale_ = theScale_/layoutAreaScale;
264+
scale_ = theScale_ / layoutAreaScale;
265265
}
266266

267267
void GetContentDimensions(const UIContext &dc, float &w, float &h) const override {
@@ -284,6 +284,8 @@ class PSPStickDragDrop : public DragDropButton {
284284
}
285285

286286
void Draw(UIContext &dc) override {
287+
scale_ = theScale_ * layoutAreaScale;
288+
287289
float opacity = GamepadGetOpacity();
288290
uint32_t colorBg = colorAlpha(GetButtonColor(), opacity);
289291

@@ -292,6 +294,8 @@ class PSPStickDragDrop : public DragDropButton {
292294

293295
dc.Draw()->DrawImage(stickBg, bounds_.centerX(), bounds_.centerY(), scale_, colorBg, ALIGN_CENTER);
294296
dc.Draw()->DrawImage(stickImage, bounds_.centerX(), bounds_.centerY(), scale_ * spacing_, colorBg, ALIGN_CENTER);
297+
298+
scale_ = theScale_ / layoutAreaScale;
295299
}
296300

297301
float GetSpacing() const override { return spacing_ * 3; }

0 commit comments

Comments
 (0)