Update overlays to use WorldAABB instead (#5128)

This commit is contained in:
metalgearsloth
2021-11-03 11:27:39 +11:00
committed by GitHub
parent 9797f3d88c
commit 3a415e1051
2 changed files with 5 additions and 5 deletions

View File

@@ -113,8 +113,8 @@ namespace Content.Client.NodeContainer
var cursorBox = Box2.CenteredAround(mouseWorldPos, (nodeSize, nodeSize)); var cursorBox = Box2.CenteredAround(mouseWorldPos, (nodeSize, nodeSize));
// Group visible nodes by grid tiles. // Group visible nodes by grid tiles.
var worldBounds = overlayDrawArgs.WorldBounds; var worldAABB = overlayDrawArgs.WorldAABB;
_lookup.FastEntitiesIntersecting(map, ref worldBounds, entity => _lookup.FastEntitiesIntersecting(map, ref worldAABB, entity =>
{ {
if (!_system.Entities.TryGetValue(entity.Uid, out var nodeData)) if (!_system.Entities.TryGetValue(entity.Uid, out var nodeData))
return; return;

View File

@@ -50,7 +50,7 @@ namespace Content.Client.Parallax
var o = new Vector2(posX * Slowness, posY * Slowness); var o = new Vector2(posX * Slowness, posY * Slowness);
// Remove offset so we can floor. // Remove offset so we can floor.
var (l, b) = args.WorldBounds.BottomLeft - o; var (l, b) = args.WorldAABB.BottomLeft - o;
// Floor to background size. // Floor to background size.
l = sizeX * MathF.Floor(l / sizeX); l = sizeX * MathF.Floor(l / sizeX);
@@ -60,9 +60,9 @@ namespace Content.Client.Parallax
l += o.X; l += o.X;
b += o.Y; b += o.Y;
for (var x = l; x < args.WorldBounds.Right; x += sizeX) for (var x = l; x < args.WorldAABB.Right; x += sizeX)
{ {
for (var y = b; y < args.WorldBounds.Top; y += sizeY) for (var y = b; y < args.WorldAABB.Top; y += sizeY)
{ {
screenHandle.DrawTexture(_parallaxTexture, (x, y)); screenHandle.DrawTexture(_parallaxTexture, (x, y));
} }