]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix docks clipping on shuttle nav (#36348)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sun, 13 Apr 2025 06:29:05 +0000 (16:29 +1000)
committerGitHub <noreply@github.com>
Sun, 13 Apr 2025 06:29:05 +0000 (16:29 +1000)
* Fix docks clipping on shuttle nav

UI scale casualty.

* review

Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs
Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs

index a5411005391df0fffbaba69554d317c624c896ab..8bb49bdb2b320c260ffe76af5bf23f09f725831e 100644 (file)
@@ -119,8 +119,6 @@ public partial class BaseShuttleControl : MapGridControl
     protected void DrawGrid(DrawingHandleScreen handle, Matrix3x2 gridToView, Entity<MapGridComponent> 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<Vector2> Vertices;
index 805608c9a5385295b5723f910e48d96be2efe619..1a0e3aae81fc44109042662030acb8cf56ee60a7 100644 (file)
@@ -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)