Update content vectors to numerics (#17759)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user