Fix the table is too wide when using indentation in RichTextLabel
Line indentation (offset) is not taken into account when calculating the available width of the table. However, when drawing a table, its offset takes into account line indentation.
This commit is contained in:
parent
92a90a8e6f
commit
76a2ab7fbf
1 changed files with 2 additions and 2 deletions
|
|
@ -514,7 +514,7 @@ float RichTextLabel::_resize_line(ItemFrame *p_frame, int p_line, const Ref<Font
|
|||
table->columns[i].width = 0;
|
||||
}
|
||||
|
||||
const int available_width = p_width - theme_cache.table_h_separation * (col_count - 1);
|
||||
const int available_width = p_width - l.offset.x - theme_cache.table_h_separation * (col_count - 1);
|
||||
int base_column_width = available_width / col_count;
|
||||
|
||||
for (Item *E : table->subitems) {
|
||||
|
|
@ -698,7 +698,7 @@ float RichTextLabel::_shape_line(ItemFrame *p_frame, int p_line, const Ref<Font>
|
|||
table->columns[i].width = 0;
|
||||
}
|
||||
// Compute minimum width for each cell.
|
||||
const int available_width = p_width - theme_cache.table_h_separation * (col_count - 1);
|
||||
const int available_width = p_width - l.offset.x - theme_cache.table_h_separation * (col_count - 1);
|
||||
int base_column_width = available_width / col_count;
|
||||
int idx = 0;
|
||||
for (Item *E : table->subitems) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue