summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexteditor.cpp
diff options
context:
space:
mode:
authorRye Mutt <rye@alchemyviewer.org>2024-08-03 10:10:17 -0400
committerRye Mutt <rye@alchemyviewer.org>2024-08-04 23:11:57 -0400
commitc4e921828a41c0e759ee103c6cfdb2cc40c1a581 (patch)
tree4e26ceeb63a58d1490a976794911c1342cbdd473 /indra/newview/llviewertexteditor.cpp
parent874794ea584588457dfde7ef17c447e2a0eb46bb (diff)
Optimization and cleanup of various color finds during draw
Diffstat (limited to 'indra/newview/llviewertexteditor.cpp')
-rw-r--r--indra/newview/llviewertexteditor.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index 15902e8a87..14228b469f 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -222,15 +222,9 @@ public:
image_rect.mTop = image_rect.mBottom + mImage->getHeight();
mImage->draw(LLRect((S32)image_rect.mLeft, (S32)image_rect.mTop, (S32)image_rect.mRight, (S32)image_rect.mBottom));
- LLColor4 color;
- if (mEditor.getReadOnly())
- {
- color = LLUIColorTable::instance().getColor("TextEmbeddedItemReadOnlyColor");
- }
- else
- {
- color = LLUIColorTable::instance().getColor("TextEmbeddedItemColor");
- }
+ static const LLUIColor embedded_item_readonly_col = LLUIColorTable::instance().getColor("TextEmbeddedItemReadOnlyColor");
+ static const LLUIColor embedded_item_col = LLUIColorTable::instance().getColor("TextEmbeddedItemColor");
+ const LLColor4& color = mEditor.getReadOnly() ? embedded_item_readonly_col : embedded_item_col;
F32 right_x;
mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::UNDERLINE, LLFontGL::NO_SHADOW, static_cast<S32>(mLabel.length()), S32_MAX, &right_x);