Generate shape outline vertices only if necessary.

This commit is contained in:
Maximilian Wagenbach 2018-01-26 15:19:41 +01:00
parent 1062e95e39
commit 14dd503c8a

View File

@ -251,6 +251,14 @@ void Shape::updateTexCoords()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Shape::updateOutline() void Shape::updateOutline()
{ {
// Return if there is no outline
if (m_outlineThickness == 0.f)
{
m_outlineVertices.clear();
m_bounds = m_insideBounds;
return;
}
std::size_t count = m_vertices.getVertexCount() - 2; std::size_t count = m_vertices.getVertexCount() - 2;
m_outlineVertices.resize((count + 1) * 2); m_outlineVertices.resize((count + 1) * 2);