diff options
author | Brad Linden <brad@lindenlab.com> | 2023-12-14 12:07:45 -0800 |
---|---|---|
committer | Brad Linden <brad@lindenlab.com> | 2023-12-14 12:07:45 -0800 |
commit | 32de0cb67d824498d0fc9d489ce19731ebfddfdf (patch) | |
tree | 9fd52f420543a5c4dc45215d7ed49faf94f386fe /indra/llui/lltextbase.cpp | |
parent | 7bfe590a3669a005d4269cdcf378891080264dce (diff) | |
parent | 4c791e098d3abafa406e0e269038c40aae67f66c (diff) |
Merge branch 'DRTVWR-596' into DRTVWR-601
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r-- | indra/llui/lltextbase.cpp | 8 |
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; } |