diff options
| author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-06-13 22:03:34 +0300 |
|---|---|---|
| committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-06-13 22:03:34 +0300 |
| commit | 23fbdacef85753cb810eed5fd5dfd0218d19f6b1 (patch) | |
| tree | a4327efd95b74d0f139aa0146b1cf462425d6fd9 | |
| parent | 680e489189796af2c34f06df49e19b17dec5c6fc (diff) | |
| download | redot-engine-23fbdacef85753cb810eed5fd5dfd0218d19f6b1.tar.gz | |
[RTL] Fix `align_to_row` for the last table row.
| -rw-r--r-- | scene/gui/rich_text_label.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index d69fa78d9d..d8da394889 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -408,7 +408,7 @@ float RichTextLabel::_resize_line(ItemFrame *p_frame, int p_line, const Ref<Font _set_table_size(table, available_width); int row_idx = (table->align_to_row < 0) ? table->rows_baseline.size() - 1 : table->align_to_row; - if (table->rows_baseline.size() != 0 && row_idx < (int)table->rows_baseline.size() - 1) { + if (table->rows_baseline.size() != 0 && row_idx < (int)table->rows_baseline.size()) { l.text_buf->resize_object(it->rid, Size2(table->total_width, table->total_height), table->inline_align, Math::round(table->rows_baseline[row_idx])); } else { l.text_buf->resize_object(it->rid, Size2(table->total_width, table->total_height), table->inline_align); @@ -632,7 +632,7 @@ float RichTextLabel::_shape_line(ItemFrame *p_frame, int p_line, const Ref<Font> _set_table_size(table, available_width); int row_idx = (table->align_to_row < 0) ? table->rows_baseline.size() - 1 : table->align_to_row; - if (table->rows_baseline.size() != 0 && row_idx < (int)table->rows_baseline.size() - 1) { + if (table->rows_baseline.size() != 0 && row_idx < (int)table->rows_baseline.size()) { l.text_buf->add_object(it->rid, Size2(table->total_width, table->total_height), table->inline_align, t_char_count, Math::round(table->rows_baseline[row_idx])); } else { l.text_buf->add_object(it->rid, Size2(table->total_width, table->total_height), table->inline_align, t_char_count); |
