From 05624ddbc8bb8288614acdc67f0849a55d55f16e Mon Sep 17 00:00:00 2001 From: Andy Savage Date: Sat, 23 Dec 2023 02:39:07 +0000 Subject: [PATCH] Fix incorrect `Rect2` size when `Transform2D` `*` operator. --- modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs index d1441aa43456..c197a6bb7520 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs @@ -487,7 +487,7 @@ public Transform2D(real_t rotation, Vector2 origin) } /// - /// Returns a Rect2 transformed (multiplied) by transformation matrix. + /// Returns a Rect2 transformed (multiplied) by the transformation matrix. /// /// The transformation to apply. /// A Rect2 to transform. @@ -498,7 +498,7 @@ public Transform2D(real_t rotation, Vector2 origin) Vector2 toX = transform.x * rect.Size.x; Vector2 toY = transform.y * rect.Size.y; - return new Rect2(pos, rect.Size).Expand(pos + toX).Expand(pos + toY).Expand(pos + toX + toY); + return new Rect2(pos, new Vector2()).Expand(pos + toX).Expand(pos + toY).Expand(pos + toX + toY); } /// @@ -514,7 +514,7 @@ public Transform2D(real_t rotation, Vector2 origin) Vector2 to2 = new Vector2(rect.Position.x + rect.Size.x, rect.Position.y + rect.Size.y) * transform; Vector2 to3 = new Vector2(rect.Position.x + rect.Size.x, rect.Position.y) * transform; - return new Rect2(pos, rect.Size).Expand(to1).Expand(to2).Expand(to3); + return new Rect2(pos, new Vector2()).Expand(to1).Expand(to2).Expand(to3); } ///