mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
svg_loader: fixing clipper transformation
In a case where both the clipper and the clippee are transformed, the final clipper transformation matrix should be calculated as the multiplication of both matrices. @Issue: https://github.com/thorvg/thorvg/issues/1255
This commit is contained in:
parent
219e23855f
commit
46147dcec7
1 changed files with 6 additions and 1 deletions
|
@ -254,7 +254,6 @@ static void _applyComposition(Paint* paint, const SvgNode* node, const Box& vBox
|
|||
node->style->clipPath.applying = true;
|
||||
|
||||
auto comp = Shape::gen();
|
||||
if (node->transform) comp->transform(*node->transform);
|
||||
|
||||
auto child = compNode->child.data;
|
||||
auto valid = false; //Composite only when valid shapes are existed
|
||||
|
@ -263,6 +262,12 @@ static void _applyComposition(Paint* paint, const SvgNode* node, const Box& vBox
|
|||
if (_appendChildShape(*child, comp.get(), vBox, svgPath)) valid = true;
|
||||
}
|
||||
|
||||
if (node->transform) {
|
||||
auto m = comp->transform();
|
||||
m = mathMultiply(node->transform, &m);
|
||||
comp->transform(m);
|
||||
}
|
||||
|
||||
if (valid) paint->composite(move(comp), CompositeMethod::ClipPath);
|
||||
|
||||
node->style->clipPath.applying = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue