summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2023-09-11 10:26:41 -0400
committerNat Goodspeed <nat@lindenlab.com>2023-09-11 10:26:41 -0400
commit947483cf14bdfcea5e0456fe00662aedfe068809 (patch)
treeffddb6bc27a2cf1bcc662f28bf1024c80291c997 /indra/llui/lltextbase.cpp
parentdc8f2ae2ba1a1348f86f412df7f769e6cc2fe541 (diff)
parent7b54f077b48740c69559c0a2089b6133ed8eb605 (diff)
DRTVWR-588: Merge 'DRTVWR-588-maint-W' into DRTVWR-588-cleanup-timers
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;
}