Fixed missing checks for empty vertex arrays when updating the vertex buffers in sf::Text. (Fixes #1558)
This commit is contained in:
parent
6d8143088e
commit
4043f71156
@ -212,6 +212,7 @@ void Text::setFillColor(const Color& color)
|
||||
if (m_verticesBuffer.getVertexCount() != m_vertices.getVertexCount())
|
||||
m_verticesBuffer.create(m_vertices.getVertexCount());
|
||||
|
||||
if (m_vertices.getVertexCount() > 0)
|
||||
m_verticesBuffer.update(&m_vertices[0]);
|
||||
}
|
||||
}
|
||||
@ -238,6 +239,7 @@ void Text::setOutlineColor(const Color& color)
|
||||
if (m_outlineVerticesBuffer.getVertexCount() != m_outlineVertices.getVertexCount())
|
||||
m_outlineVerticesBuffer.create(m_outlineVertices.getVertexCount());
|
||||
|
||||
if (m_outlineVertices.getVertexCount() > 0)
|
||||
m_outlineVerticesBuffer.update(&m_outlineVertices[0]);
|
||||
}
|
||||
}
|
||||
@ -617,11 +619,13 @@ void Text::ensureGeometryUpdate() const
|
||||
if (m_verticesBuffer.getVertexCount() != m_vertices.getVertexCount())
|
||||
m_verticesBuffer.create(m_vertices.getVertexCount());
|
||||
|
||||
if (m_vertices.getVertexCount() > 0)
|
||||
m_verticesBuffer.update(&m_vertices[0]);
|
||||
|
||||
if (m_outlineVerticesBuffer.getVertexCount() != m_outlineVertices.getVertexCount())
|
||||
m_outlineVerticesBuffer.create(m_outlineVertices.getVertexCount());
|
||||
|
||||
if (m_outlineVertices.getVertexCount() > 0)
|
||||
m_outlineVerticesBuffer.update(&m_outlineVertices[0]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user