Merge pull request #112952 from MadeScientist/MadeScientist-patch-1

Fix incorrect equivalent method reference in screen-space transform methods doc
This commit is contained in:
Rémi Verschelde 2025-12-01 11:48:45 +01:00
commit a5bb19a0d2
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 7 additions and 3 deletions

View file

@ -520,7 +520,7 @@
<return type="Transform2D" />
<description>
Returns the transform of this [CanvasItem] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.
Equals to [method get_global_transform] if the window is embedded (see [member Viewport.gui_embed_subwindows]).
Equivalent to [method get_global_transform_with_canvas] if the window is embedded (see [member Viewport.gui_embed_subwindows]).
</description>
</method>
<method name="get_transform" qualifiers="const">

View file

@ -493,10 +493,14 @@
<return type="Vector2" />
<description>
Returns the position of this [Control] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.
Equals to [member global_position] if the window is embedded (see [member Viewport.gui_embed_subwindows]).
Equivalent to [code]get_screen_transform().origin[/code] (see [method CanvasItem.get_screen_transform]).
[b]Example:[/b] Show a popup at the mouse position:
[codeblock]
popup_menu.position = get_screen_position() + get_local_mouse_position()
popup_menu.position = get_screen_position() + get_screen_transform().basis_xform(get_local_mouse_position())
# The above code is equivalent to:
popup_menu.position = get_screen_transform() * get_local_mouse_position()
popup_menu.reset_size()
popup_menu.popup()
[/codeblock]