Fix docks clipping on shuttle nav (#36348)
* Fix docks clipping on shuttle nav UI scale casualty. * review
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user