summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontgl.cpp
diff options
context:
space:
mode:
authorYchebotarev ProductEngine <ychebotarev@productengine.com>2010-01-11 15:09:23 +0200
committerYchebotarev ProductEngine <ychebotarev@productengine.com>2010-01-11 15:09:23 +0200
commit31c5c18f6c1325060fa3ea3fb2253168fd98adda (patch)
tree137927cad5301959cb7b1f3c026b0c873676686f /indra/llrender/llfontgl.cpp
parent4a902dd76ae1bbf2e080632ebb51896ed6f007b3 (diff)
parentd0c029c6094bf23ad9a016d9029b830d674a566a (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/llrender/llfontgl.cpp')
-rw-r--r--indra/llrender/llfontgl.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 37a28ac721..1de1d6ded4 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -472,7 +472,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars
}
// Returns the max number of complete characters from text (up to max_chars) that can be drawn in max_pixels
-S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_chars, BOOL end_on_word_boundary) const
+S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_chars, EWordWrapStyle end_on_word_boundary) const
{
if (!wchars || !wchars[0] || max_chars == 0)
{
@@ -562,9 +562,24 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
drawn_x = cur_x;
}
- if( clip && end_on_word_boundary && (start_of_last_word != 0) )
+ if( clip )
{
- i = start_of_last_word;
+ switch (end_on_word_boundary)
+ {
+ case ONLY_WORD_BOUNDARIES:
+ i = start_of_last_word;
+ break;
+ case WORD_BOUNDARY_IF_POSSIBLE:
+ if (start_of_last_word != 0)
+ {
+ i = start_of_last_word;
+ }
+ break;
+ default:
+ case ANYWHERE:
+ // do nothing
+ break;
+ }
}
return i;
}