X Tutup
Skip to content

Commit efe7bce

Browse files
xan2622PunkPun
authored andcommitted
Shift Color Picker panel left if it would extend beyond the right edge of the screen
1 parent a6f5002 commit efe7bce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ public void AttachPanel(Widget p, Action onCancel)
136136
if (panelY + oldBounds.Height > Game.Renderer.Resolution.Height)
137137
panelY -= Bounds.Height + oldBounds.Height;
138138

139+
var buttonRightEdge = RenderOrigin.X + Bounds.Width - panelRoot.RenderOrigin.X;
140+
if (panelX + oldBounds.Width > Game.Renderer.Resolution.Width)
141+
panelX = buttonRightEdge - oldBounds.Width;
142+
139143
panel.Bounds = new WidgetBounds(
140144
panelX,
141145
panelY,

0 commit comments

Comments
 (0)
X Tutup