SimpleTextDrawer: Don't regenerate glyphs on outline color update
This commit is contained in:
parent
17236880d2
commit
57264a5650
|
|
@ -177,7 +177,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
m_outlineColor = color;
|
m_outlineColor = color;
|
||||||
|
|
||||||
m_glyphUpdated = false;
|
m_colorUpdated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleTextDrawer::SetOutlineThickness(float thickness)
|
void SimpleTextDrawer::SetOutlineThickness(float thickness)
|
||||||
|
|
@ -514,9 +514,23 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleTextDrawer::UpdateGlyphColor() const
|
void SimpleTextDrawer::UpdateGlyphColor() const
|
||||||
|
{
|
||||||
|
if (m_outlineThickness > 0.f)
|
||||||
|
{
|
||||||
|
for (std::size_t glyphIndex = 0; glyphIndex < m_glyphs.size(); ++glyphIndex)
|
||||||
|
{
|
||||||
|
Glyph& glyph = m_glyphs[glyphIndex];
|
||||||
|
if (glyphIndex % 2 == 0)
|
||||||
|
glyph.color = m_outlineColor;
|
||||||
|
else
|
||||||
|
glyph.color = m_color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (Glyph& glyph : m_glyphs)
|
for (Glyph& glyph : m_glyphs)
|
||||||
glyph.color = m_color;
|
glyph.color = m_color;
|
||||||
|
}
|
||||||
|
|
||||||
m_colorUpdated = true;
|
m_colorUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue