mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Fixes SS14Window going off-screen.
This commit is contained in:
@@ -96,7 +96,7 @@ namespace Robust.Client.UserInterface.CustomControls
|
||||
var (spaceX, spaceY) = Parent!.Size;
|
||||
if (Position.Y > spaceY)
|
||||
{
|
||||
LayoutContainer.SetPosition(this, (Position.X, spaceY - HEADER_SIZE_Y));
|
||||
LayoutContainer.SetPosition(this, (Position.X, spaceY + HEADER_SIZE_Y));
|
||||
}
|
||||
|
||||
if (Position.X > spaceX)
|
||||
@@ -104,6 +104,16 @@ namespace Robust.Client.UserInterface.CustomControls
|
||||
// 50 is arbitrary here. As long as it's bumped back into view.
|
||||
LayoutContainer.SetPosition(this, (spaceX - 50, Position.Y));
|
||||
}
|
||||
|
||||
if (Position.Y < 0)
|
||||
{
|
||||
LayoutContainer.SetPosition(this, (Position.X, 0));
|
||||
}
|
||||
|
||||
if (Position.X < 0)
|
||||
{
|
||||
LayoutContainer.SetPosition(this, (0, Position.Y));
|
||||
}
|
||||
}
|
||||
|
||||
protected override DragMode GetDragModeFor(Vector2 relativeMousePos)
|
||||
|
||||
Reference in New Issue
Block a user