Shift Color Picker panel left if it would extend beyond the right edge of the screen

This commit is contained in:
xan2622
2026-01-31 22:30:54 +01:00
committed by Gustas Kažukauskas
parent a6f5002a84
commit efe7bce08a

View File

@@ -136,6 +136,10 @@ namespace OpenRA.Mods.Common.Widgets
if (panelY + oldBounds.Height > Game.Renderer.Resolution.Height)
panelY -= Bounds.Height + oldBounds.Height;
var buttonRightEdge = RenderOrigin.X + Bounds.Width - panelRoot.RenderOrigin.X;
if (panelX + oldBounds.Width > Game.Renderer.Resolution.Width)
panelX = buttonRightEdge - oldBounds.Width;
panel.Bounds = new WidgetBounds(
panelX,
panelY,