mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-04 03:40:07 +00:00
Made the SVG parser set the component ID of the drawables it creates.
This commit is contained in:
parent
c7ed08a008
commit
fd21b02845
1 changed files with 10 additions and 3 deletions
|
|
@ -54,7 +54,7 @@ public:
|
|||
|
||||
DrawableComposite* const drawable = new DrawableComposite();
|
||||
|
||||
drawable->setName (xml->getStringAttribute ("id"));
|
||||
setDrawableID (*drawable, xml);
|
||||
|
||||
SVGState newState (*this);
|
||||
|
||||
|
|
@ -363,6 +363,13 @@ private:
|
|||
AffineTransform transform;
|
||||
String cssStyleText;
|
||||
|
||||
static void setDrawableID (Drawable& d, const XmlPath& xml)
|
||||
{
|
||||
String compID (xml->getStringAttribute ("id"));
|
||||
d.setName (compID);
|
||||
d.setComponentID (compID);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void parseSubElements (const XmlPath& xml, DrawableComposite& parentDrawable)
|
||||
{
|
||||
|
|
@ -402,7 +409,7 @@ private:
|
|||
{
|
||||
DrawableComposite* const drawable = new DrawableComposite();
|
||||
|
||||
drawable->setName (xml->getStringAttribute ("id"));
|
||||
setDrawableID (*drawable, xml);
|
||||
|
||||
if (xml->hasAttribute ("transform"))
|
||||
{
|
||||
|
|
@ -547,7 +554,7 @@ private:
|
|||
}
|
||||
|
||||
DrawablePath* dp = new DrawablePath();
|
||||
dp->setName (xml->getStringAttribute ("id"));
|
||||
setDrawableID (*dp, xml);
|
||||
dp->setFill (Colours::transparentBlack);
|
||||
|
||||
path.applyTransform (transform);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue