From fd312d1929de708e5765cf1b3815cb61752fc355 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 14 Oct 2009 20:16:18 +0000 Subject: improved metrics for llfontgl::getWidth (use greater of character width/xadvance) llfontgl::Addchar now called consistently when requesting font metrics no longer possible to have font glyph info without rendered font EXT-1294 - LLExpandableTextBox: wrong ellipses reviewed by James and Mani --- indra/newview/llexpandabletextbox.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview/llexpandabletextbox.cpp') diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 2467356018..e2d6bcee8f 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -57,7 +57,20 @@ public: { return start_offset; } - /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const { return getEnd() - getStart(); } + /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const + { + // require full line to ourselves + if (line_offset == 0) + { + // print all our text + return getEnd() - getStart(); + } + else + { + // wait for next line + return 0; + } + } /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) { F32 right_x; -- cgit v1.2.3