mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-10-30 07:11:05 +00:00
button_guide: fix LB/RB prompt clipping 4:3 aspect ratio (#439)
This commit is contained in:
parent
d812c12d06
commit
8ff365cbaa
1 changed files with 6 additions and 6 deletions
|
|
@ -157,19 +157,19 @@ static void DrawGuide(float* offset, ImVec2 regionMin, ImVec2 regionMax, EButton
|
||||||
{
|
{
|
||||||
auto iconMarginX = Scale(16);
|
auto iconMarginX = Scale(16);
|
||||||
|
|
||||||
iconMin = alignment == EButtonAlignment::Left
|
iconMin.x = alignment == EButtonAlignment::Left
|
||||||
? ImVec2(/* X */ regionMin.x + *offset - maxTextWidth + iconMarginX, /* Y */ iconMin.y)
|
? regionMin.x + *offset - maxTextWidth + (iconWidth / 2)
|
||||||
: ImVec2(/* X */ regionMax.x - *offset - maxTextWidth + iconMarginX - iconWidth, /* Y */ iconMin.y);
|
: regionMax.x - *offset - maxTextWidth - (iconWidth / 2) - iconMarginX;
|
||||||
|
|
||||||
iconMax = ImVec2(iconMin.x + iconWidth, iconMax.y);
|
iconMax.x = iconMin.x + iconWidth;
|
||||||
|
|
||||||
// Left button.
|
// Left button.
|
||||||
auto btnIcon = GetButtonIcon(icon == EButtonIcon::LBRB ? EButtonIcon::LB : EButtonIcon::LT);
|
auto btnIcon = GetButtonIcon(icon == EButtonIcon::LBRB ? EButtonIcon::LB : EButtonIcon::LT);
|
||||||
drawList->AddImage(std::get<1>(btnIcon), iconMin, iconMax, GET_UV_COORDS(std::get<0>(btnIcon)));
|
drawList->AddImage(std::get<1>(btnIcon), iconMin, iconMax, GET_UV_COORDS(std::get<0>(btnIcon)));
|
||||||
|
|
||||||
auto dualIconMin = alignment == EButtonAlignment::Left
|
auto dualIconMin = alignment == EButtonAlignment::Left
|
||||||
? ImVec2(/* X */ regionMin.x + *offset + maxTextWidth - iconMarginX, /* Y */ iconMin.y)
|
? ImVec2(iconMax.x + maxTextWidth + iconMarginX, iconMin.y)
|
||||||
: ImVec2(/* X */ regionMax.x - *offset + maxTextWidth - iconMarginX - iconWidth, /* Y */ iconMin.y);
|
: ImVec2(regionMax.x - *offset + maxTextWidth - iconWidth, iconMin.y);
|
||||||
|
|
||||||
auto dualIconMax = ImVec2(dualIconMin.x + iconWidth, iconMax.y);
|
auto dualIconMax = ImVec2(dualIconMin.x + iconWidth, iconMax.y);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue