diff options
author | richard <none@none> | 2010-01-06 12:23:56 -0800 |
---|---|---|
committer | richard <none@none> | 2010-01-06 12:23:56 -0800 |
commit | 49660730308fb6d5301d1617402a353a21e9d9be (patch) | |
tree | 90887ce7d989a2ceb6a5e5f23aa9b2a123ab5abb /indra/llui | |
parent | 3b7080a6b112c492a9025ae1a350db0ab4e88e50 (diff) |
moved clipping logic inside LLFontGL::maxDrawableChars controlled by EWordWrapStyle
fixes regression introduced in 3eef5ce9ae1e6fc62b9b52ce859501dd4e70fadf
reviewed by Brad
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llconsole.cpp | 7 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index 7248581ec6..f69e935754 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -330,12 +330,7 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, b skip_chars = 0; } - U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_end - paragraph_offset, TRUE); - if (drawable == 0) - { - // try again without wrapping on word boundaries - drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_end - paragraph_offset, FALSE); - } + U32 drawable = font->maxDrawableChars(mParagraphText.c_str()+paragraph_offset, screen_width, line_end - paragraph_offset, LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); if (drawable != 0) { 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 |