Merge pull request #29573 from qarmin/fix_rich_text_process_line

Fix RichLabelText::_process_line crash
This commit is contained in:
Rémi Verschelde 2019-06-11 16:00:03 +02:00 committed by GitHub
commit 15425b450f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -592,7 +592,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
//assign actual widths
for (int i = 0; i < table->columns.size(); i++) {
table->columns.write[i].width = table->columns[i].min_width;
if (table->columns[i].expand)
if (table->columns[i].expand && total_ratio > 0)
table->columns.write[i].width += table->columns[i].expand_ratio * remaining_width / total_ratio;
table->total_width += table->columns[i].width + hseparation;
}