diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/rich_text_label.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 4be53839be..3489b02598 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -268,7 +268,9 @@ if (m_height > line_height) {\ } if (found_space) { - fw+=l.offset_caches[line]/l.space_caches[line]; + int ln = MIN(l.offset_caches.size()-1,line); + + fw+=l.offset_caches[ln]/l.space_caches[ln]; } } |