瀏覽代碼

Merge pull request #98423 from Calinou/doc-textedit-is-caret-visible

Clarify `TextEdit.is_caret_visible()` behavior in the class reference
Thaddeus Crews 8 月之前
父節點
當前提交
ab5a539549
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      doc/classes/TextEdit.xml

+ 2 - 1
doc/classes/TextEdit.xml

@@ -763,7 +763,8 @@
 			<return type="bool" />
 			<param index="0" name="caret_index" type="int" default="0" />
 			<description>
-				Returns [code]true[/code] if the caret is visible on the screen.
+				Returns [code]true[/code] if the caret is visible, [code]false[/code] otherwise. A caret will be considered hidden if it is outside the scrollable area when scrolling is enabled.
+				[b]Note:[/b] [method is_caret_visible] does not account for a caret being off-screen if it is still within the scrollable area. It will return [code]true[/code] even if the caret is off-screen as long as it meets [TextEdit]'s own conditions for being visible. This includes uses of [member scroll_fit_content_width] and [member scroll_fit_content_height] that cause the [TextEdit] to expand beyond the viewport's bounds.
 			</description>
 		</method>
 		<method name="is_dragging_cursor" qualifiers="const">