summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-08-29 01:57:44 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-08-29 13:22:53 +0300
commit35c0f1a7697731ed481fe41807e3f04eb5ec5045 (patch)
tree252244f19f21e5eef72aa7bdf42c6eb7aa184bbc /indra/llui
parent3d2da2b2c09fc637c2eaccac1607e3480bede145 (diff)
SL-20205 Clipping of label "Water"
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltextbase.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 8732a7ce45..e0697cb454 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1550,7 +1550,13 @@ S32 LLTextBase::getLeftOffset(S32 width)
case LLFontGL::HCENTER:
return mHPad + llmax(0, (mVisibleTextRect.getWidth() - width - mHPad) / 2);
case LLFontGL::RIGHT:
- return mVisibleTextRect.getWidth() - width;
+ {
+ // Font's rendering rounds string size, if value gets rounded
+ // down last symbol might not have enough space to render,
+ // compensate by adding an extra pixel as padding
+ const S32 right_padding = 1;
+ return llmax(mHPad, mVisibleTextRect.getWidth() - width - right_padding);
+ }
default:
return mHPad;
}