mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Generate shape outline vertices only if necessary.
This commit is contained in:
parent
1062e95e39
commit
14dd503c8a
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user