mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Fix issues searching RichTextLabel when search result is in a table
Fixes for cases where search results would be skipped or repeatedly found involving tables in RichTextLabel: - If previous result was found in last cell of table, earlier cells would be skipped, since the end of the table was reached. Updated to not skip earlier cells when searching in reverse. - When choosing next line to continue from after searching table, the inner line number within the table's cell was added, causing the search to jump forward if not on line 0 in the cell. This could cause lines to get skipped when searching forward, or searching the table again when searching in reverse. Updated to continue from the immediate next line before/after the table. - If a table cell has multiple lines, repeated searching would only include the line where the previous result was found, then jump to the next cell. Updated to search remaining lines in the same cell first.
This commit is contained in:
parent
c81fd6c512
commit
f0eddb8e6f
2 changed files with 44 additions and 18 deletions
|
|
@ -631,8 +631,9 @@ private:
|
|||
void _find_click(ItemFrame *p_frame, const Point2i &p_click, ItemFrame **r_click_frame = nullptr, int *r_click_line = nullptr, Item **r_click_item = nullptr, int *r_click_char = nullptr, bool *r_outside = nullptr, bool p_meta = false);
|
||||
|
||||
String _get_line_text(ItemFrame *p_frame, int p_line, Selection p_sel) const;
|
||||
bool _search_line(ItemFrame *p_frame, int p_line, const String &p_string, int p_char_idx, bool p_reverse_search);
|
||||
bool _search_table_cell(ItemTable *p_table, List<Item *>::Element *p_cell, const String &p_string, bool p_reverse_search, int p_from_line);
|
||||
bool _search_table(ItemTable *p_table, List<Item *>::Element *p_from, const String &p_string, bool p_reverse_search);
|
||||
bool _search_line(ItemFrame *p_frame, int p_line, const String &p_string, int p_char_idx, bool p_reverse_search);
|
||||
|
||||
float _shape_line(ItemFrame *p_frame, int p_line, const Ref<Font> &p_base_font, int p_base_font_size, int p_width, float p_h, int *r_char_offset);
|
||||
float _resize_line(ItemFrame *p_frame, int p_line, const Ref<Font> &p_base_font, int p_base_font_size, int p_width, float p_h);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue