Skip to content

Commit

Permalink
Fix scaling issue in touch control layout screen, thanks @iota97
Browse files Browse the repository at this point in the history
See #19573
  • Loading branch information
hrydgard committed Nov 2, 2024
1 parent d20bde8 commit 6b753c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion UI/TouchControlLayoutScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);

Expand All @@ -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; }
Expand Down

0 comments on commit 6b753c1

Please sign in to comment.