summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-08-29 01:57:44 +0300
committerAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-09-04 23:20:13 +0200
commitf059ace6f79cd2866fab7027ca22188c806799f8 (patch)
tree8050ecb5750760c5071c69c7584cc23c248949f0 /indra/llui/lltextbase.cpp
parent1a89ff73ac210f596887443013857a8ed88a9a00 (diff)
SL-20205 Clipping of label "Water"
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-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 26a38bd541..b6d27a3211 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;
}