From ff0a80751a240711eecfac9d9592652d0d34d209 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 11 May 2025 13:05:15 +0900 Subject: [PATCH] Use fast invert helper in hot path --- .../Graphics/Containers/UprightAspectMaintainingContainer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/UprightAspectMaintainingContainer.cs b/osu.Game/Graphics/Containers/UprightAspectMaintainingContainer.cs index f263ae36cb..7845054178 100644 --- a/osu.Game/Graphics/Containers/UprightAspectMaintainingContainer.cs +++ b/osu.Game/Graphics/Containers/UprightAspectMaintainingContainer.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using osu.Framework.Extensions.MatrixExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Layout; @@ -54,7 +55,8 @@ namespace osu.Game.Graphics.Containers parentMatrix.M31 = 0.0f; parentMatrix.M32 = 0.0f; - Matrix3 reversedParent = parentMatrix.Inverted(); + Matrix3 reversedParent = parentMatrix; + MatrixExtensions.FastInvert(ref reversedParent); // Extract the rotation. float angle = MathF.Atan2(reversedParent.M12, reversedParent.M11);