diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2020-12-27 20:23:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-27 20:23:00 +0100 |
commit | bf9db223528ff608dd93a080be963c0efad723dd (patch) | |
tree | 09fab1262d72aa41a773ca6e44332278fa1a7cb6 | |
parent | 1c2727332ebeb4ba66efa3c76db94944463d449e (diff) | |
parent | 3fda53c256f7bbefbcfc4904a1d46f0ebc32dd7d (diff) |
Merge pull request #44582 from nathanfranke/document-rect-intersection
Update Rect intersection documentation, and rename method on Mono
-rw-r--r-- | doc/classes/Rect2.xml | 3 | ||||
-rw-r--r-- | doc/classes/Rect2i.xml | 3 | ||||
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs | 5 | ||||
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2i.cs | 5 |
4 files changed, 10 insertions, 6 deletions
diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 8feeb91b97..34f81948c4 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -78,7 +78,8 @@ <argument index="0" name="b" type="Rect2"> </argument> <description> - Returns the intersection of this [Rect2] and b. + Returns the intersection of this [Rect2] and [code]b[/code]. + If the rectangles do not intersect, an empty [Rect2] is returned. </description> </method> <method name="encloses"> diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index 80f2a87f31..d354adf892 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -76,7 +76,8 @@ <argument index="0" name="b" type="Rect2i"> </argument> <description> - Returns the intersection of this [Rect2i] and b. + Returns the intersection of this [Rect2i] and [code]b[/code]. + If the rectangles do not intersect, an empty [Rect2i] is returned. </description> </method> <method name="encloses"> diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs index f7703c77cc..a4f6f7d5ec 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs @@ -74,10 +74,11 @@ namespace Godot /// <summary> /// Returns the intersection of this Rect2 and `b`. + /// If the rectangles do not intersect, an empty Rect2 is returned. /// </summary> /// <param name="b">The other rect.</param> - /// <returns>The clipped rect.</returns> - public Rect2 Clip(Rect2 b) + /// <returns>The intersection of this Rect2 and `b`, or an empty rect if they do not intersect.</returns> + public Rect2 Intersection(Rect2 b) { var newRect = b; diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2i.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2i.cs index 8f71c00d76..ed29fb144c 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2i.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2i.cs @@ -69,10 +69,11 @@ namespace Godot /// <summary> /// Returns the intersection of this Rect2i and `b`. + /// If the rectangles do not intersect, an empty Rect2i is returned. /// </summary> /// <param name="b">The other rect.</param> - /// <returns>The clipped rect.</returns> - public Rect2i Clip(Rect2i b) + /// <returns>The intersection of this Rect2i and `b`, or an empty rect if they do not intersect.</returns> + public Rect2i Intersection(Rect2i b) { var newRect = b; |