Forráskód Böngészése

avoid crash on some cases of richtextlabel fill, but odd behavior persists, #1803

Juan Linietsky 10 éve
szülő
commit
36932a0065
1 módosított fájl, 3 hozzáadás és 1 törlés
  1. 3 1
      scene/gui/rich_text_label.cpp

+ 3 - 1
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];
 						}
 
 					}