From efe7bce08acb60ae203d7f8189a47b360ecab6d2 Mon Sep 17 00:00:00 2001 From: xan2622 Date: Sat, 31 Jan 2026 22:30:54 +0100 Subject: [PATCH] Shift Color Picker panel left if it would extend beyond the right edge of the screen --- OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs b/OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs index c9bb97a577..559c009f04 100644 --- a/OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs +++ b/OpenRA.Mods.Common/Widgets/DropDownButtonWidget.cs @@ -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,