diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-04-08 22:53:56 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-04-09 20:48:34 +0300 |
| commit | 5f91a3faf3ef0b9d0a6c3424fff119992dc0822a (patch) | |
| tree | 31fe46c41da8a3f691cbc0e456f1b5f95f039a1a /indra/newview/llviewertexteditor.cpp | |
| parent | 130c50cf8d4de021f510b17fd02fcac88a67c5e6 (diff) | |
#5626 LLTextBase optimization
by caching string width
Diffstat (limited to 'indra/newview/llviewertexteditor.cpp')
| -rw-r--r-- | indra/newview/llviewertexteditor.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 210cd62d6f..95e34b4df1 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -189,7 +189,12 @@ public: return new LLEmbeddedItemSegment(mStart, mImage, mItem, *editor); } - /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const + /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) + { + return getSegmentDimensionsF32(first_char, num_chars, width, height); + } + + inline bool getSegmentDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const { if (num_chars == 0) { @@ -213,8 +218,9 @@ public: } else { - S32 width, height; - getDimensions(mStart, 1, width, height); + F32 width; + S32 height; + getSegmentDimensionsF32(mStart, 1, width, height); if (width > num_pixels) { return 0; |
