summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-12-14 14:12:01 -0600
committerRunitaiLinden <davep@lindenlab.com>2023-12-14 14:12:01 -0600
commit3c858d7e2d6633df14df473a918d2fb848403972 (patch)
tree62b36692a0c1df2f34a85bc7fd4111afb2737d81 /indra/llui/lltextbase.cpp
parent8b86e2ad1b1326cb3e98acd857dc93f4f1455b8c (diff)
parent32de0cb67d824498d0fc9d489ce19731ebfddfdf (diff)
Merge branch 'DRTVWR-601' of github.com:secondlife/viewer into DRTVWR-601
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 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;
}