[RTL] Fix `align_to_row` for the last table row.

This commit is contained in:
bruvzg 2024-06-13 22:03:34 +03:00
parent 680e489189
commit 23fbdacef8
No known key found for this signature in database
GPG Key ID: 7960FCF39844EC38
1 changed files with 2 additions and 2 deletions

View File

@ -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);