Expose TextEdit get_visible_rows() and get_total_visible_rows() to GDScript

This commit is contained in:
Wilson E. Alvarez 2022-03-07 15:12:39 -05:00
parent 85b4848ca8
commit c37be0f31b
No known key found for this signature in database
GPG Key ID: A32174A3D2ED3F9E
2 changed files with 14 additions and 0 deletions

View File

@ -239,6 +239,18 @@
Returns the total width of all gutters and internal padding. Returns the total width of all gutters and internal padding.
</description> </description>
</method> </method>
<method name="get_total_visible_rows" qualifiers="const">
<return type="int" />
<description>
Returns the total amount of lines that could be drawn.
</description>
</method>
<method name="get_visible_rows" qualifiers="const">
<return type="int" />
<description>
Returns the number of visible lines, including wrapped text.
</description>
</method>
<method name="get_word_under_cursor" qualifiers="const"> <method name="get_word_under_cursor" qualifiers="const">
<return type="String" /> <return type="String" />
<description> <description>

View File

@ -7298,6 +7298,8 @@ void TextEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_draw_fold_gutter"), &TextEdit::set_draw_fold_gutter); ClassDB::bind_method(D_METHOD("set_draw_fold_gutter"), &TextEdit::set_draw_fold_gutter);
ClassDB::bind_method(D_METHOD("is_drawing_fold_gutter"), &TextEdit::is_drawing_fold_gutter); ClassDB::bind_method(D_METHOD("is_drawing_fold_gutter"), &TextEdit::is_drawing_fold_gutter);
ClassDB::bind_method(D_METHOD("get_total_gutter_width"), &TextEdit::get_total_gutter_width); ClassDB::bind_method(D_METHOD("get_total_gutter_width"), &TextEdit::get_total_gutter_width);
ClassDB::bind_method(D_METHOD("get_visible_rows"), &TextEdit::get_visible_rows);
ClassDB::bind_method(D_METHOD("get_total_visible_rows"), &TextEdit::get_total_visible_rows);
ClassDB::bind_method(D_METHOD("set_hiding_enabled", "enable"), &TextEdit::set_hiding_enabled); ClassDB::bind_method(D_METHOD("set_hiding_enabled", "enable"), &TextEdit::set_hiding_enabled);
ClassDB::bind_method(D_METHOD("is_hiding_enabled"), &TextEdit::is_hiding_enabled); ClassDB::bind_method(D_METHOD("is_hiding_enabled"), &TextEdit::is_hiding_enabled);