diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-01-07 16:20:27 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-01-07 16:20:27 -0500 |
commit | 6abd41831a4cae5d757aa44675731d1fd48d64b1 (patch) | |
tree | 6fc9de74e865a8337823b317a87b7c132bca0c7a /indra/llui/lltextbase.cpp | |
parent | bb04795eeb222e5396e24e79ac1f77b155bd4622 (diff) | |
parent | 6b8ed2ae6f92d6f9559cbc86699b9ca3197f2e81 (diff) |
automated merge viewer2.0->viewer2.0
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r-- | indra/llui/lltextbase.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7447a984ac..5ebf49c488 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2509,10 +2509,15 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin // set max characters to length of segment, or to first newline max_chars = llmin(max_chars, last_char - (mStart + segment_offset)); + // if no character yet displayed on this line, don't require word wrapping since + // we can just move to the next line, otherwise insist on it so we make forward progress + LLFontGL::EWordWrapStyle word_wrap_style = (line_offset == 0) + ? LLFontGL::WORD_BOUNDARY_IF_POSSIBLE + : LLFontGL::ONLY_WORD_BOUNDARIES; S32 num_chars = mStyle->getFont()->maxDrawableChars(text.c_str() + segment_offset + mStart, (F32)num_pixels, max_chars, - TRUE); + word_wrap_style); if (num_chars == 0 && line_offset == 0 |