Update content vectors to numerics (#17759)

This commit is contained in:
metalgearsloth
2023-07-08 14:08:32 +10:00
committed by GitHub
parent 15772478c9
commit 68480af109
383 changed files with 978 additions and 575 deletions

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.Chat.Managers;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
@@ -80,7 +81,7 @@ namespace Content.Client.Chat.UI
ForceRunStyleUpdate();
bubble.Measure(Vector2.Infinity);
bubble.Measure(Vector2Helpers.Infinity);
ContentSize = bubble.DesiredSize;
_verticalOffsetAchieved = -ContentSize.Y;
}
@@ -130,7 +131,7 @@ namespace Content.Client.Chat.UI
var worldPos = xform.WorldPosition + offset;
var lowerCenter = _eyeManager.WorldToScreen(worldPos) / UIScale;
var screenPos = lowerCenter - (ContentSize.X / 2, ContentSize.Y + _verticalOffsetAchieved);
var screenPos = lowerCenter - new Vector2(ContentSize.X / 2, ContentSize.Y + _verticalOffsetAchieved);
// Round to nearest 0.5
screenPos = (screenPos * 2).Rounded() / 2;
LayoutContainer.SetPosition(this, screenPos);