[buffer] Add optional merge_clusters arg to reverse_groups()
This commit is contained in:
parent
e949e51218
commit
21c4fc1011
|
@ -210,7 +210,8 @@ struct hb_buffer_t
|
|||
void reverse () { reverse_range (0, len); }
|
||||
|
||||
template <typename FuncType>
|
||||
void reverse_groups (const FuncType& group)
|
||||
void reverse_groups (const FuncType& group,
|
||||
bool merge_clusters = false)
|
||||
{
|
||||
if (unlikely (!len))
|
||||
return;
|
||||
|
@ -223,10 +224,14 @@ struct hb_buffer_t
|
|||
{
|
||||
if (!group (info[i - 1], info[i]))
|
||||
{
|
||||
if (merge_clusters)
|
||||
this->merge_clusters (start, i);
|
||||
reverse_range (start, i);
|
||||
start = i;
|
||||
}
|
||||
}
|
||||
if (merge_clusters)
|
||||
this->merge_clusters (start, i);
|
||||
reverse_range (start, i);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue