Kaynağa Gözat

Merge pull request #72770 from Kabiirk/Control-has-point-doc-update

Fix description and argument name in `Control._has_point`
Rémi Verschelde 2 yıl önce
ebeveyn
işleme
fe2cd2e6b1
2 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 3 3
      doc/classes/Control.xml
  2. 1 1
      scene/gui/control.cpp

+ 3 - 3
doc/classes/Control.xml

@@ -144,11 +144,11 @@
 		</method>
 		</method>
 		<method name="_has_point" qualifiers="virtual const">
 		<method name="_has_point" qualifiers="virtual const">
 			<return type="bool" />
 			<return type="bool" />
-			<param index="0" name="position" type="Vector2" />
+			<param index="0" name="point" type="Vector2" />
 			<description>
 			<description>
-				Virtual method to be implemented by the user. Returns whether the given [param position] is inside this control.
+				Virtual method to be implemented by the user. Returns whether the given [param point] is inside this control.
 				If not overridden, default behavior is checking if the point is within control's Rect.
 				If not overridden, default behavior is checking if the point is within control's Rect.
-				[b]Note:[/b] If you want to check if a point is inside the control, you can use [code]get_rect().has_point(point)[/code].
+				[b]Note:[/b] If you want to check if a point is inside the control, you can use [code]Rect2(Vector2.ZERO, size).has_point(point)[/code].
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="_make_custom_tooltip" qualifiers="virtual const">
 		<method name="_make_custom_tooltip" qualifiers="virtual const">

+ 1 - 1
scene/gui/control.cpp

@@ -3392,7 +3392,7 @@ void Control::_bind_methods() {
 	ADD_SIGNAL(MethodInfo("minimum_size_changed"));
 	ADD_SIGNAL(MethodInfo("minimum_size_changed"));
 	ADD_SIGNAL(MethodInfo("theme_changed"));
 	ADD_SIGNAL(MethodInfo("theme_changed"));
 
 
-	GDVIRTUAL_BIND(_has_point, "position");
+	GDVIRTUAL_BIND(_has_point, "point");
 	GDVIRTUAL_BIND(_structured_text_parser, "args", "text");
 	GDVIRTUAL_BIND(_structured_text_parser, "args", "text");
 	GDVIRTUAL_BIND(_get_minimum_size);
 	GDVIRTUAL_BIND(_get_minimum_size);