Shift Color Picker panel left if it would extend beyond the right edge of the screen
This commit is contained in:
committed by
Gustas Kažukauskas
parent
a6f5002a84
commit
efe7bce08a
@@ -136,6 +136,10 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
if (panelY + oldBounds.Height > Game.Renderer.Resolution.Height)
|
if (panelY + oldBounds.Height > Game.Renderer.Resolution.Height)
|
||||||
panelY -= Bounds.Height + oldBounds.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(
|
panel.Bounds = new WidgetBounds(
|
||||||
panelX,
|
panelX,
|
||||||
panelY,
|
panelY,
|
||||||
|
|||||||
Reference in New Issue
Block a user