فهرست منبع

Merge pull request #44582 from nathanfranke/document-rect-intersection

Update Rect intersection documentation, and rename method on Mono
Rémi Verschelde 4 سال پیش
والد
کامیت
bf9db22352

+ 2 - 1
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">

+ 2 - 1
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">

+ 3 - 2
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;
 

+ 3 - 2
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;