Skip to content

Commit

Permalink
cleaner bounds checks
Browse files Browse the repository at this point in the history
  • Loading branch information
whatston3 committed Jan 16, 2025
1 parent 7f45150 commit ac779f7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ private void DrawDocks(DrawingHandleScreen handle, EntityUid uid, Matrix3x2 grid
}

// Frontier: draw dock labels (done last to appear on top of all docks, still fights with other grids)
var labeled = new HashSet<string>(); // Frontier
var labeled = new HashSet<string>();
foreach (var state in docks)
{
if (state.LabelName == null || labeled.Contains(state.LabelName))
Expand All @@ -406,10 +406,7 @@ private void DrawDocks(DrawingHandleScreen handle, EntityUid uid, Matrix3x2 grid
var position = state.Coordinates.Position;
var uiPosition = Vector2.Transform(position, gridToView);

if (uiPosition.X < 0 || uiPosition.X > Width)
continue;

if (uiPosition.Y < 0 || uiPosition.Y > Height)
if (!viewBounds.Contains(uiPosition))
continue;

labeled.Add(state.LabelName);
Expand Down

0 comments on commit ac779f7

Please sign in to comment.