diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-05-05 00:37:06 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-05-05 00:37:06 -0300 |
commit | 36932a006541b9c3614fbceca331b2dae38a011f (patch) | |
tree | 2235a713bc300964f0bf2b358f4fd5654747d841 /scene | |
parent | 9b03ea903e17d133a1122aeee5ab54e22ab16110 (diff) |
avoid crash on some cases of richtextlabel fill, but odd behavior persists, #1803
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]; } } |