I stumbled upon a svg bug with new lunasvg parser in juce 9 .
Any svg group node with opacity (or other render-like attributes), will not set the name of it’s corresponding juce::DrawableComposite
<g id="ThisIdWillNotPropagateToDrawableName" opacity="0.96">
...
</g>
<g id="ThisIdWillWorkOk">
...
</g>
I feel its a straight forward bug to fix in SVGParser.cpp, but it may have been explicitly ignored because of some edge cases I can not think of right now.
My one line fix would be :
DrawableCanvas::blendCanvas() should also set the name to getElementIdBeingRendered() as other functions are doing in this same class (i.e drawImage()…)
void blendCanvas (const Canvas& canvas, lunasvg::BlendMode blendMode, float opacity) override
{
{...}
std::unique_ptr<DrawableComposite> other { static_cast<DrawableComposite*> (drawableCanvas->composite->createCopy().release()) };
other->setName (document.getElementIdBeingRendered()); // added this line!!!
{...}
}
I posted here following github guildelines, but I could happily do a gluten-free/AI-free PR or issue if simpler…
let me know, cheers!
