[set] Fix algebra
Was totally b0rked. Ouch! Fixes https://github.com/harfbuzz/harfbuzz/issues/863
This commit is contained in:
parent
7587683cdc
commit
f014a124f5
|
@ -389,6 +389,7 @@ struct hb_set_t
|
||||||
|
|
||||||
unsigned int na = pages.len;
|
unsigned int na = pages.len;
|
||||||
unsigned int nb = other->pages.len;
|
unsigned int nb = other->pages.len;
|
||||||
|
unsigned int next_page = na;
|
||||||
|
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
unsigned int a = 0, b = 0;
|
unsigned int a = 0, b = 0;
|
||||||
|
@ -431,6 +432,7 @@ struct hb_set_t
|
||||||
a--;
|
a--;
|
||||||
b--;
|
b--;
|
||||||
count--;
|
count--;
|
||||||
|
page_map[count] = page_map[a];
|
||||||
Op::process (page_at (count).v, page_at (a).v, other->page_at (b).v);
|
Op::process (page_at (count).v, page_at (a).v, other->page_at (b).v);
|
||||||
}
|
}
|
||||||
else if (page_map[a - 1].major > other->page_map[b - 1].major)
|
else if (page_map[a - 1].major > other->page_map[b - 1].major)
|
||||||
|
@ -439,7 +441,7 @@ struct hb_set_t
|
||||||
if (Op::passthru_left)
|
if (Op::passthru_left)
|
||||||
{
|
{
|
||||||
count--;
|
count--;
|
||||||
page_at (count).v = page_at (a).v;
|
page_map[count] = page_map[a];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -448,16 +450,28 @@ struct hb_set_t
|
||||||
if (Op::passthru_right)
|
if (Op::passthru_right)
|
||||||
{
|
{
|
||||||
count--;
|
count--;
|
||||||
|
page_map[count].major = other->page_map[b].major;
|
||||||
|
page_map[count].index = next_page++;
|
||||||
page_at (count).v = other->page_at (b).v;
|
page_at (count).v = other->page_at (b).v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Op::passthru_left)
|
if (Op::passthru_left)
|
||||||
while (a)
|
while (a)
|
||||||
page_at (--count).v = page_at (--a).v;
|
{
|
||||||
|
a--;
|
||||||
|
count--;
|
||||||
|
page_map[count] = page_map [a];
|
||||||
|
}
|
||||||
if (Op::passthru_right)
|
if (Op::passthru_right)
|
||||||
while (b)
|
while (b)
|
||||||
page_at (--count).v = other->page_at (--b).v;
|
{
|
||||||
|
b--;
|
||||||
|
count--;
|
||||||
|
page_map[count].major = other->page_map[b].major;
|
||||||
|
page_map[count].index = next_page++;
|
||||||
|
page_at (count).v = other->page_at (b).v;
|
||||||
|
}
|
||||||
assert (!count);
|
assert (!count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue