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,7 +212,8 @@ void Text::setFillColor(const Color& color)
|
|||||||
if (m_verticesBuffer.getVertexCount() != m_vertices.getVertexCount())
|
if (m_verticesBuffer.getVertexCount() != m_vertices.getVertexCount())
|
||||||
m_verticesBuffer.create(m_vertices.getVertexCount());
|
m_verticesBuffer.create(m_vertices.getVertexCount());
|
||||||
|
|
||||||
m_verticesBuffer.update(&m_vertices[0]);
|
if (m_vertices.getVertexCount() > 0)
|
||||||
|
m_verticesBuffer.update(&m_vertices[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -238,7 +239,8 @@ void Text::setOutlineColor(const Color& color)
|
|||||||
if (m_outlineVerticesBuffer.getVertexCount() != m_outlineVertices.getVertexCount())
|
if (m_outlineVerticesBuffer.getVertexCount() != m_outlineVertices.getVertexCount())
|
||||||
m_outlineVerticesBuffer.create(m_outlineVertices.getVertexCount());
|
m_outlineVerticesBuffer.create(m_outlineVertices.getVertexCount());
|
||||||
|
|
||||||
m_outlineVerticesBuffer.update(&m_outlineVertices[0]);
|
if (m_outlineVertices.getVertexCount() > 0)
|
||||||
|
m_outlineVerticesBuffer.update(&m_outlineVertices[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -617,12 +619,14 @@ void Text::ensureGeometryUpdate() const
|
|||||||
if (m_verticesBuffer.getVertexCount() != m_vertices.getVertexCount())
|
if (m_verticesBuffer.getVertexCount() != m_vertices.getVertexCount())
|
||||||
m_verticesBuffer.create(m_vertices.getVertexCount());
|
m_verticesBuffer.create(m_vertices.getVertexCount());
|
||||||
|
|
||||||
m_verticesBuffer.update(&m_vertices[0]);
|
if (m_vertices.getVertexCount() > 0)
|
||||||
|
m_verticesBuffer.update(&m_vertices[0]);
|
||||||
|
|
||||||
if (m_outlineVerticesBuffer.getVertexCount() != m_outlineVertices.getVertexCount())
|
if (m_outlineVerticesBuffer.getVertexCount() != m_outlineVertices.getVertexCount())
|
||||||
m_outlineVerticesBuffer.create(m_outlineVertices.getVertexCount());
|
m_outlineVerticesBuffer.create(m_outlineVertices.getVertexCount());
|
||||||
|
|
||||||
m_outlineVerticesBuffer.update(&m_outlineVertices[0]);
|
if (m_outlineVertices.getVertexCount() > 0)
|
||||||
|
m_outlineVerticesBuffer.update(&m_outlineVertices[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user