diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-27 10:30:15 +0100 | 
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-27 10:30:15 +0100 | 
| commit | af1ef4c94f57ff280916e10c9190f4a11a8bbd44 (patch) | |
| tree | 0b7e8f2712d87cfafd5606a6a88a9a4b0b4df26d | |
| parent | d8bcbde677b466d0b770d1193f55d5142e7e2ca3 (diff) | |
| parent | 03df4e3fcee87d10a2d1724554f1806931ed2bba (diff) | |
Merge pull request #72149 from MinusKube/rich_text_visible_chars_bug
Fix char offset calculation when processing RichTextLabel line caches
| -rw-r--r-- | scene/gui/rich_text_label.cpp | 2 | 
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 9baf7c9180..71ee3c8d0d 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -2808,7 +2808,7 @@ void RichTextLabel::_process_line_caches() {  	int ctrl_height = get_size().height;  	int fi = main->first_invalid_line.load(); -	int total_chars = (fi == 0) ? 0 : (main->lines[fi].char_offset + main->lines[fi].char_count); +	int total_chars = main->lines[fi].char_offset;  	float total_height = (fi == 0) ? 0 : _calculate_line_vertical_offset(main->lines[fi - 1]);  	for (int i = fi; i < (int)main->lines.size(); i++) {  |