mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
svg_loader: fix clipping in use/symbol nodes
Clipping for the <use> node when a <symbol> was used, was being overridden when 'overflowVisible' was 'true' (the default value), which caused the 'clip-path' applied to the <use> node to have no visible effect. The clipping for the <use> node (without <symbol> node) was transformed in an incorrect order, resulting in a visually incorrect results. @Issue: https://github.com/thorvg/thorvg/issues/3392
This commit is contained in:
parent
ea6cfdf3da
commit
00f6600499
1 changed files with 13 additions and 3 deletions
|
@ -752,12 +752,22 @@ static unique_ptr<Scene> _useBuildHelper(SvgLoaderData& loaderData, const SvgNod
|
||||||
}
|
}
|
||||||
viewBoxClip->transform(mClipTransform);
|
viewBoxClip->transform(mClipTransform);
|
||||||
|
|
||||||
scene->clip(std::move(viewBoxClip));
|
auto clippingLayer = Scene::gen();
|
||||||
|
clippingLayer->clip(std::move(viewBoxClip));
|
||||||
|
clippingLayer->push(std::move(scene));
|
||||||
|
return clippingLayer;
|
||||||
}
|
}
|
||||||
} else {
|
return scene;
|
||||||
scene->transform(mUseTransform);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (auto clipper = scene->Paint::pImpl->clipper) {
|
||||||
|
auto clipTransform = clipper->transform();
|
||||||
|
Matrix inv;
|
||||||
|
if (node->transform && inverse(node->transform, &inv)) clipTransform = inv * clipTransform;
|
||||||
|
clipper->transform(mUseTransform * clipTransform);
|
||||||
|
}
|
||||||
|
|
||||||
|
scene->transform(mUseTransform);
|
||||||
return scene;
|
return scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue