Add support for opening DropDownButtonWidget upwards if clipped by the viewport
This commit is contained in:
committed by
reaperrr
parent
e23054631d
commit
3fb60740be
@@ -101,9 +101,13 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
panelRoot.AddChild(fullscreenMask);
|
panelRoot.AddChild(fullscreenMask);
|
||||||
|
|
||||||
var oldBounds = panel.Bounds;
|
var oldBounds = panel.Bounds;
|
||||||
|
var panelY = RenderOrigin.Y + Bounds.Height - panelRoot.RenderOrigin.Y;
|
||||||
|
if (panelY + oldBounds.Height > Game.Renderer.Resolution.Height)
|
||||||
|
panelY -= (Bounds.Height + oldBounds.Height);
|
||||||
|
|
||||||
panel.Bounds = new Rectangle(
|
panel.Bounds = new Rectangle(
|
||||||
RenderOrigin.X - panelRoot.RenderOrigin.X,
|
RenderOrigin.X - panelRoot.RenderOrigin.X,
|
||||||
RenderOrigin.Y + Bounds.Height - panelRoot.RenderOrigin.Y,
|
panelY,
|
||||||
oldBounds.Width,
|
oldBounds.Width,
|
||||||
oldBounds.Height);
|
oldBounds.Height);
|
||||||
panelRoot.AddChild(panel);
|
panelRoot.AddChild(panel);
|
||||||
|
|||||||
Reference in New Issue
Block a user