From 83aaa73f0e04a1fe67c2f4abfb77bbd9681d6b8c Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sun, 13 Apr 2025 16:29:05 +1000 Subject: [PATCH] Fix docks clipping on shuttle nav (#36348) * Fix docks clipping on shuttle nav UI scale casualty. * review --- Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs | 6 ------ Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs b/Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs index a541100539..8bb49bdb2b 100644 --- a/Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs +++ b/Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs @@ -119,8 +119,6 @@ public partial class BaseShuttleControl : MapGridControl protected void DrawGrid(DrawingHandleScreen handle, Matrix3x2 gridToView, Entity grid, Color color, float alpha = 0.01f) { var rator = Maps.GetAllTilesEnumerator(grid.Owner, grid.Comp); - var minimapScale = MinimapScale; - var midpoint = new Vector2(MidPoint, MidPoint); var tileSize = grid.Comp.TileSize; // Check if we even have data @@ -263,9 +261,7 @@ public partial class BaseShuttleControl : MapGridControl var edgeCount = totalData - gridData.EdgeIndex; Extensions.EnsureLength(ref _allVertices, totalData); - _drawJob.MidPoint = midpoint; _drawJob.Matrix = gridToView; - _drawJob.MinimapScale = minimapScale; _drawJob.Vertices = gridData.Vertices; _drawJob.ScaledVertices = _allVertices; @@ -288,8 +284,6 @@ public partial class BaseShuttleControl : MapGridControl { public int BatchSize => 64; - public float MinimapScale; - public Vector2 MidPoint; public Matrix3x2 Matrix; public List Vertices; diff --git a/Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs b/Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs index 805608c9a5..1a0e3aae81 100644 --- a/Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs +++ b/Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs @@ -303,7 +303,12 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl const float sqrt2 = 1.41421356f; const float dockRadius = DockScale * sqrt2; // Worst-case bounds used to cull a dock: - Box2 viewBounds = new Box2(-dockRadius, -dockRadius, Size.X + dockRadius, Size.Y + dockRadius); + Box2 viewBounds = new Box2( + -dockRadius * UIScale, + -dockRadius * UIScale, + (Size.X + dockRadius) * UIScale, + (Size.Y + dockRadius) * UIScale); + if (_docks.TryGetValue(nent, out var docks)) { foreach (var state in docks)