Extend clusters backwards, into the out-buffer too

This commit is contained in:
Behdad Esfahbod 2012-06-08 20:27:53 -04:00
parent 77471e0371
commit cd5891493d
1 changed files with 9 additions and 0 deletions

View File

@ -436,6 +436,15 @@ hb_buffer_t::merge_clusters (unsigned int start,
while (end < len && info[end - 1].cluster == info[end].cluster)
end++;
/* Extend start */
while (idx < start && info[start - 1].cluster == info[start].cluster)
start--;
/* If we hit the start of buffer, continue in out-buffer. */
if (idx == start)
for (unsigned i = out_len; i && out_info[i - 1].cluster == info[start].cluster; i--)
out_info[i - 1].cluster = cluster;
for (unsigned int i = start; i < end; i++)
info[i].cluster = cluster;
}