summaryrefslogtreecommitdiff
path: root/indra/newview/llhudtext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llhudtext.cpp')
-rw-r--r--indra/newview/llhudtext.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index 0b5da40be4..b95e5f53e8 100644
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -607,6 +607,11 @@ void LLHUDText::addLine(const LLWString &wstr, const LLColor4& color, const LLFo
do
{
S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wline.length(), TRUE);
+ if (segment_length == 0)
+ {
+ // try again without wrapping on word boundaries
+ segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wline.length(), FALSE);
+ }
mTextSegments.push_back(LLHUDTextSegment(iter->substr(line_length, segment_length), style, color));
line_length += segment_length;
}
@@ -643,6 +648,11 @@ void LLHUDText::setLabel(const LLWString &wlabel)
do
{
S32 segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wstr.length(), TRUE);
+ if (segment_length == 0)
+ {
+ // try again without wrapping on word boundaries
+ segment_length = mFontp->maxDrawableChars(iter->substr(line_length).c_str(), mUseBubble ? HUD_TEXT_MAX_WIDTH : HUD_TEXT_MAX_WIDTH_NO_BUBBLE, wstr.length(), FALSE);
+ }
mLabelSegments.push_back(LLHUDTextSegment(iter->substr(line_length, segment_length), LLFontGL::NORMAL, mColor));
line_length += segment_length;
}