clamp instead of assert when running out of room during reflow

master
richard 2009-12-17 11:44:01 -08:00
parent 724f5fbb7f
commit 9abe9bf5df
1 changed files with 4 additions and 0 deletions

View File

@ -1137,6 +1137,10 @@ void LLTextBase::reflow(S32 start_index)
// grow line height as necessary based on reported height of this segment
line_height = llmax(line_height, segment_height);
remaining_pixels -= segment_width;
if (remaining_pixels < 0)
{
remaining_pixels = 0;
}
// getNumChars() and getDimensions() should return consistent results
llassert_always(remaining_pixels >= 0);