From 187a4b638d8648977fa148bd409750096542fad2 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Jul 2010 19:48:39 -0700 Subject: EXT-7654 - About Land Floater> Icons missing fixed layout of embedded icons in text labels --- indra/llrender/llfontgl.cpp | 22 ++++++++++++++++++++++ indra/llrender/llfontgl.h | 20 ++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index d9e1976341..f17ea6ca98 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -118,6 +118,28 @@ BOOL LLFontGL::loadFace(const std::string& filename, F32 point_size, F32 vert_dp static LLFastTimer::DeclareTimer FTM_RENDER_FONTS("Fonts"); +S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, + ShadowType shadow, S32 max_chars, F32* right_x, BOOL use_ellipses) const +{ + F32 x = rect.mLeft; + F32 y = 0.f; + + switch(valign) + { + case TOP: + y = rect.mTop; + break; + case VCENTER: + y = rect.getCenterY(); + break; + case BOTTOM: + y = rect.mBottom; + break; + } + return render(wstr, begin_offset, x, y, color, halign, valign, style, shadow, max_chars, rect.getWidth(), right_x, use_ellipses); +} + + S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, ShadowType shadow, S32 max_chars, S32 max_pixels, F32* right_x, BOOL use_ellipses) const { diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index dfa4cf8ce5..f29ac5165c 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -95,8 +95,24 @@ public: BOOL loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback); - S32 render(const LLWString &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign = LEFT, VAlign valign = BASELINE, U8 style = NORMAL, - ShadowType shadow = NO_SHADOW, S32 max_chars = S32_MAX, S32 max_pixels = S32_MAX, F32* right_x=NULL, BOOL use_ellipses = FALSE) const; + S32 render(const LLWString &text, S32 begin_offset, + const LLRect& rect, + const LLColor4 &color, + HAlign halign = LEFT, VAlign valign = BASELINE, + U8 style = NORMAL, ShadowType shadow = NO_SHADOW, + S32 max_chars = S32_MAX, + F32* right_x=NULL, + BOOL use_ellipses = FALSE) const; + + S32 render(const LLWString &text, S32 begin_offset, + F32 x, F32 y, + const LLColor4 &color, + HAlign halign = LEFT, VAlign valign = BASELINE, + U8 style = NORMAL, ShadowType shadow = NO_SHADOW, + S32 max_chars = S32_MAX, S32 max_pixels = S32_MAX, + F32* right_x=NULL, + BOOL use_ellipses = FALSE) const; + S32 render(const LLWString &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color) const; // renderUTF8 does a conversion, so is slower! -- cgit v1.2.3 From ee7fce63fe706734b5931fb9d2bb351c0be71c83 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Jul 2010 21:29:25 -0700 Subject: missed some cases in font valign switch --- indra/llrender/llfontgl.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llrender') diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index f17ea6ca98..6eb5e0eff4 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -132,9 +132,13 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect case VCENTER: y = rect.getCenterY(); break; + case BASELINE: case BOTTOM: y = rect.mBottom; break; + default: + y = rect.mBottom; + break; } return render(wstr, begin_offset, x, y, color, halign, valign, style, shadow, max_chars, rect.getWidth(), right_x, use_ellipses); } -- cgit v1.2.3