diff --git a/Content.Client/Viewport/ScalingViewport.cs b/Content.Client/Viewport/ScalingViewport.cs index 63f7f65de1..d920444bbd 100644 --- a/Content.Client/Viewport/ScalingViewport.cs +++ b/Content.Client/Viewport/ScalingViewport.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Robust.Client.Graphics; using Robust.Client.Input; @@ -276,14 +276,11 @@ namespace Content.Client.Viewport var drawBox = GetDrawBox(); var scaleFactor = drawBox.Size / (Vector2) _viewport!.Size; - if (scaleFactor == (0, 0)) + if (scaleFactor.X == 0 || scaleFactor.Y == 0) // Basically a nonsense scenario, at least make sure to return something that can be inverted. return Matrix3.Identity; - var scale = Matrix3.CreateScale(scaleFactor); - var translate = Matrix3.CreateTranslation(GlobalPixelPosition + drawBox.TopLeft); - - return scale * translate; + return Matrix3.CreateTransform(GlobalPixelPosition + drawBox.TopLeft, 0, scaleFactor); } private void EnsureViewportCreated()