mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-30 10:04:24 +01:00
[buffer] Add optional merge_clusters arg to reverse_groups()
This commit is contained in:
1 parent
e949e51218
commit
21c4fc1011
1 file changed
+6
-1
+6
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user