mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 06:38:43 +00:00
tvg_saver: fixing unwanted merging
Similar shapes are merged to improve performance. This should not be the case with a semi-transparent fill, different shapes' fill-rule or fill-rule set to evenodd. @Issue: https://github.com/thorvg/thorvg/issues/1440
This commit is contained in:
parent
6d16713ce9
commit
77114a8ac8
1 changed files with 4 additions and 1 deletions
|
@ -75,7 +75,10 @@ static bool _merge(Shape* from, Shape* to)
|
|||
from->fillColor(&r, &g, &b, &a);
|
||||
to->fillColor(&r2, &g2, &b2, &a2);
|
||||
|
||||
if (r != r2 || g != g2 || b != b2 || a != a2) return false;
|
||||
if (r != r2 || g != g2 || b != b2 || a != a2 || a < 255) return false;
|
||||
|
||||
auto fromRule = from->fillRule();
|
||||
if (fromRule == FillRule::EvenOdd || fromRule != to->fillRule()) return false;
|
||||
|
||||
//composition
|
||||
if (from->composite(nullptr) != CompositeMethod::None) return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue