summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorMinusKube <minuskube@gmail.com>2023-01-27 01:50:25 +0100
committerMinusKube <minuskube@gmail.com>2023-01-27 01:54:47 +0100
commit03df4e3fcee87d10a2d1724554f1806931ed2bba (patch)
tree4adbfbf5b17719a2058b316abd2c021ea8e4e790 /scene/gui
parent56fdef281ecc40e8ce10d4e17aa1357b150aca18 (diff)
Fix char offset calculation when processing RichTextLabel line caches
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/rich_text_label.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index a7e50a765e..f802d7dec5 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++) {