simplify logic
This commit is contained in:
parent
49c28cb6ad
commit
fe7d1e2f53
1 changed files with 14 additions and 30 deletions
|
@ -149,38 +149,22 @@ static void shape_text(text_line & line,
|
|||
}
|
||||
|
||||
// if we have a valid codepoint, save rendering info.
|
||||
if (glyphs[i].codepoint)
|
||||
{
|
||||
auto itr = glyphinfos.find(cluster);
|
||||
if (itr == glyphinfos.end())
|
||||
{
|
||||
std::vector<glyph_face_info> v = {{ face, glyphs[i], positions[i] }};
|
||||
bool result = false;
|
||||
std::tie(itr, result) = glyphinfos.insert(std::make_pair(cluster, v));
|
||||
|
||||
}
|
||||
if (itr->second.front().glyph.codepoint == 0)
|
||||
{
|
||||
itr->second.front() = { face, glyphs[i], positions[i] };
|
||||
}
|
||||
else if (in_cluster)
|
||||
{
|
||||
itr->second.push_back({ face, glyphs[i], positions[i] });
|
||||
}
|
||||
}
|
||||
else
|
||||
auto itr = glyphinfos.find(cluster);
|
||||
if (itr == glyphinfos.end())
|
||||
{
|
||||
auto itr = glyphinfos.find(cluster);
|
||||
if (itr == glyphinfos.end())
|
||||
{
|
||||
std::vector<glyph_face_info> v = {{ face, glyphs[i], positions[i] }};
|
||||
bool result = false;
|
||||
std::tie(itr, result) = glyphinfos.insert(std::make_pair(cluster, v));
|
||||
}
|
||||
if (itr != glyphinfos.end() && itr->second.front().glyph.codepoint == 0)
|
||||
{
|
||||
itr->second.front() = { face, glyphs[i], positions[i] };
|
||||
}
|
||||
std::vector<glyph_face_info> v = {{ face, glyphs[i], positions[i] }};
|
||||
bool result = false;
|
||||
std::tie(itr, result) = glyphinfos.insert(std::make_pair(cluster, v));
|
||||
|
||||
}
|
||||
if (itr->second.front().glyph.codepoint == 0)
|
||||
{
|
||||
itr->second.front() = { face, glyphs[i], positions[i] };
|
||||
}
|
||||
else if (in_cluster)
|
||||
{
|
||||
itr->second.push_back({ face, glyphs[i], positions[i] });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue