[CTL] Fix RichTextLabel cell horizontal padding.
This commit is contained in:
parent
2f391bd9c3
commit
1f60ac1e08
|
@ -776,6 +776,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
|
|||
Color odd_row_bg = get_theme_color("table_odd_row_bg");
|
||||
Color even_row_bg = get_theme_color("table_even_row_bg");
|
||||
Color border = get_theme_color("table_border");
|
||||
int hseparation = get_theme_constant("table_hseparation");
|
||||
int col_count = table->columns.size();
|
||||
int row_count = table->rows.size();
|
||||
|
||||
|
@ -792,11 +793,11 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
|
|||
coff.x = rect.size.width - table->columns[col].width - coff.x;
|
||||
}
|
||||
if (row % 2 == 0) {
|
||||
draw_rect(Rect2(p_ofs + rect.position + off + coff - frame->padding.position, Size2(table->columns[col].width, table->rows[row])), (frame->odd_row_bg != Color(0, 0, 0, 0) ? frame->odd_row_bg : odd_row_bg), true);
|
||||
draw_rect(Rect2(p_ofs + rect.position + off + coff - frame->padding.position, Size2(table->columns[col].width + hseparation + frame->padding.position.x + frame->padding.size.x, table->rows[row])), (frame->odd_row_bg != Color(0, 0, 0, 0) ? frame->odd_row_bg : odd_row_bg), true);
|
||||
} else {
|
||||
draw_rect(Rect2(p_ofs + rect.position + off + coff - frame->padding.position, Size2(table->columns[col].width, table->rows[row])), (frame->even_row_bg != Color(0, 0, 0, 0) ? frame->even_row_bg : even_row_bg), true);
|
||||
draw_rect(Rect2(p_ofs + rect.position + off + coff - frame->padding.position, Size2(table->columns[col].width + hseparation + frame->padding.position.x + frame->padding.size.x, table->rows[row])), (frame->even_row_bg != Color(0, 0, 0, 0) ? frame->even_row_bg : even_row_bg), true);
|
||||
}
|
||||
draw_rect(Rect2(p_ofs + rect.position + off + coff - frame->padding.position, Size2(table->columns[col].width, table->rows[row])), (frame->border != Color(0, 0, 0, 0) ? frame->border : border), false);
|
||||
draw_rect(Rect2(p_ofs + rect.position + off + coff - frame->padding.position, Size2(table->columns[col].width + hseparation + frame->padding.position.x + frame->padding.size.x, table->rows[row])), (frame->border != Color(0, 0, 0, 0) ? frame->border : border), false);
|
||||
}
|
||||
|
||||
for (int j = 0; j < frame->lines.size(); j++) {
|
||||
|
|
Loading…
Reference in New Issue