Adds get_selection_line_offset to RichTextLabel
This new method allow you to get the line offset of the current selection (returns -1 if nothing is selected.) This is useful if you want to pop up a control or menu above the currently selected text. Previously there was no accurate way to get this information. The logic is moved from the implementation of `scroll_to_selection` verbatim, and that method has been adjusted to avoid repetition.
This commit is contained in:
@@ -190,6 +190,12 @@
|
||||
Returns the current selection first character index if a selection is active, [code]-1[/code] otherwise. Does not include BBCodes.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_selection_line_offset" qualifiers="const">
|
||||
<return type="float" />
|
||||
<description>
|
||||
Returns the current selection vertical line offset if a selection is active, [code]-1.0[/code] otherwise.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_selection_to" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
|
||||
Reference in New Issue
Block a user