svg_loader: fix transformation order

If a clip was defined by a use node pointing
to a basic shape subject to transformation, and
the use node itself was translated, the order
of applying these transformations was incorrect.
This commit is contained in:
Mira Grudzinska 2025-01-01 18:40:30 +01:00 committed by Hermet Park
parent 2fb925a2d7
commit defec5e43b

View file

@ -191,7 +191,7 @@ static bool _appendClipChild(SvgLoaderData& loaderData, SvgNode* node, Shape* sh
if (node->node.use.x != 0.0f || node->node.use.y != 0.0f) {
finalTransform *= {1, 0, node->node.use.x, 0, 1, node->node.use.y, 0, 0, 1};
}
if (child->transform) finalTransform = *child->transform * finalTransform;
if (child->transform) finalTransform *= *child->transform;
return _appendClipShape(loaderData, child, shape, vBox, svgPath, identity((const Matrix*)(&finalTransform)) ? nullptr : &finalTransform);
}