quarantee glyphinfos
has enough capacity to hold cluster
This commit is contained in:
parent
fbdff42d47
commit
86e5f9305b
1 changed files with 15 additions and 14 deletions
|
@ -148,21 +148,22 @@ static void shape_text(text_line & line,
|
||||||
{
|
{
|
||||||
in_cluster = true;
|
in_cluster = true;
|
||||||
}
|
}
|
||||||
if (glyphinfos.size() > cluster)
|
if (glyphinfos.size() <= cluster)
|
||||||
{
|
{
|
||||||
auto & c = glyphinfos[cluster];
|
glyphinfos.resize(cluster + 1);
|
||||||
if (c.empty())
|
}
|
||||||
{
|
auto & c = glyphinfos[cluster];
|
||||||
c.push_back({face, glyphs[i], positions[i]});
|
if (c.empty())
|
||||||
}
|
{
|
||||||
if (c.front().glyph.codepoint == 0)
|
c.push_back({face, glyphs[i], positions[i]});
|
||||||
{
|
}
|
||||||
c.front() = { face, glyphs[i], positions[i] };
|
if (c.front().glyph.codepoint == 0)
|
||||||
}
|
{
|
||||||
else if (in_cluster)
|
c.front() = { face, glyphs[i], positions[i] };
|
||||||
{
|
}
|
||||||
c.push_back({ face, glyphs[i], positions[i] });
|
else if (in_cluster)
|
||||||
}
|
{
|
||||||
|
c.push_back({ face, glyphs[i], positions[i] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool all_set = true;
|
bool all_set = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue