1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

SVG: Ensure that transformed images are positioned correctly

This commit is contained in:
ed 2018-08-16 09:42:57 +01:00
parent 2b52ce105d
commit b8b77df0ed

View file

@ -1203,13 +1203,14 @@ private:
setCommonAttributes (*di, xml);
di->setImage (image);
if (additionalTransform != nullptr)
di->setTransform (transform.followedBy (*additionalTransform));
else
di->setTransform (transform);
di->setTransformToFit ({ (float) xml->getDoubleAttribute ("x", 0.0), (float) xml->getDoubleAttribute ("y", 0.0),
(float) xml->getDoubleAttribute ("width", 0.0), (float) xml->getDoubleAttribute ("height", 0.0) },
RectanglePlacement (parsePlacementFlags (xml->getStringAttribute ("preserveAspectRatio").trim())));
di->setBoundingBox ({ (float) xml->getDoubleAttribute ("x", 0.0), (float) xml->getDoubleAttribute ("y", 0.0),
(float) xml->getDoubleAttribute ("width", 0.0), (float) xml->getDoubleAttribute ("height", 0.0) });
if (additionalTransform != nullptr)
di->setTransform (di->getTransform().followedBy (transform).followedBy (*additionalTransform));
else
di->setTransform (di->getTransform().followedBy (transform));
return di;
}