diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2021-01-12 14:03:10 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2021-01-18 11:26:55 +0200 |
commit | e4651a44abfbf59c477b3ad0b3e5e6b069104ce0 (patch) | |
tree | 06c1ef61b3bc1a4b5d6ef6aa1d7ef9810aafed43 /scene/gui/rich_text_label.h | |
parent | 380bb2d5330ac5c79d701c46d5462f4e0da56403 (diff) |
RichTextLabel: adds separate `get_total_x_count`, `get_visible_x_count` and `scroll_to_x` functions for wrapped lines and paragraphs (newlines).
Diffstat (limited to 'scene/gui/rich_text_label.h')
-rw-r--r-- | scene/gui/rich_text_label.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index a65cc5a451..ee37efb68b 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -337,6 +337,7 @@ private: bool updating_scroll; int current_idx = 1; int current_char_ofs = 0; + int visible_paragraph_count; int visible_line_count; int tab_size; @@ -393,7 +394,7 @@ private: void _shape_line(ItemFrame *p_frame, int p_line, const Ref<Font> &p_base_font, int p_base_font_size, int p_width, int *r_char_offset); void _resize_line(ItemFrame *p_frame, int p_line, const Ref<Font> &p_base_font, int p_base_font_size, int p_width); - void _draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_ofs, int p_width, const Color &p_base_color, int p_outline_size, const Color &p_outline_color, const Color &p_font_color_shadow, bool p_shadow_as_outline, const Point2 &shadow_ofs); + int _draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_ofs, int p_width, const Color &p_base_color, int p_outline_size, const Color &p_outline_color, const Color &p_font_color_shadow, bool p_shadow_as_outline, const Point2 &shadow_ofs); float _find_click_in_line(ItemFrame *p_frame, int p_line, const Vector2 &p_ofs, int p_width, const Point2i &p_click, ItemFrame **r_click_frame = nullptr, int *r_click_line = nullptr, Item **r_click_item = nullptr, int *r_click_char = nullptr); String _roman(int p_num, bool p_capitalize) const; @@ -507,6 +508,10 @@ public: bool search(const String &p_string, bool p_from_selection = false, bool p_search_previous = false); + void scroll_to_paragraph(int p_paragraph); + int get_paragraph_count() const; + int get_visible_paragraph_count() const; + void scroll_to_line(int p_line); int get_line_count() const; int get_visible_line_count() const; |