mirror of
https://github.com/love2d/love.git
synced 2026-08-20 20:49:54 +02:00
Fix Text:set(" ") not properly clearing the internal buffer (resolves issue #1518).
This commit is contained in:
@@ -111,21 +111,23 @@ void Text::addTextData(const TextData &t)
|
|||||||
else
|
else
|
||||||
new_commands = font->generateVerticesFormatted(t.codepoints, constantcolor, t.wrap, t.align, vertices, &text_info);
|
new_commands = font->generateVerticesFormatted(t.codepoints, constantcolor, t.wrap, t.align, vertices, &text_info);
|
||||||
|
|
||||||
|
size_t voffset = vert_offset;
|
||||||
|
|
||||||
|
// Must be before the early exit below.
|
||||||
|
if (!t.append_vertices)
|
||||||
|
{
|
||||||
|
voffset = 0;
|
||||||
|
vert_offset = 0;
|
||||||
|
draw_commands.clear();
|
||||||
|
text_data.clear();
|
||||||
|
}
|
||||||
|
|
||||||
if (vertices.empty())
|
if (vertices.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (t.use_matrix)
|
if (t.use_matrix)
|
||||||
t.matrix.transformXY(&vertices[0], &vertices[0], (int) vertices.size());
|
t.matrix.transformXY(&vertices[0], &vertices[0], (int) vertices.size());
|
||||||
|
|
||||||
size_t voffset = vert_offset;
|
|
||||||
|
|
||||||
if (!t.append_vertices)
|
|
||||||
{
|
|
||||||
voffset = 0;
|
|
||||||
draw_commands.clear();
|
|
||||||
text_data.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
uploadVertices(vertices, voffset);
|
uploadVertices(vertices, voffset);
|
||||||
|
|
||||||
if (!new_commands.empty())
|
if (!new_commands.empty())
|
||||||
|
|||||||
Reference in New Issue
Block a user