Browse Source

SVG: Ensure that transformed images are positioned correctly

tags/2021-05-28
ed 7 years ago
parent
commit
b8b77df0ed
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      modules/juce_gui_basics/drawables/juce_SVGParser.cpp

+ 6
- 5
modules/juce_gui_basics/drawables/juce_SVGParser.cpp View File

@@ -1203,13 +1203,14 @@ private:
setCommonAttributes (*di, xml);
di->setImage (image);
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())));
if (additionalTransform != nullptr)
di->setTransform (transform.followedBy (*additionalTransform));
di->setTransform (di->getTransform().followedBy (transform).followedBy (*additionalTransform));
else
di->setTransform (transform);
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) });
di->setTransform (di->getTransform().followedBy (transform));
return di;
}


Loading…
Cancel
Save