drawsvg
drawsvg copied to clipboard
gradient stop animation
am i missing something or is these as it stands no way to add an animation to a gradient stop?
closed because i found the otherElem parameter of the Animate() class.
Glad you solved it. Was the issue that you couldn't do something like this?
gradient = ...
stop = gradient.addStop(...) # addStop doesn't return anything currently.
stop.appendAnim(...)
Can you share how you did it using the otherElem parameter?
That was exactly what i tried yea. The otherElem parameter sets the xlink:href attribute of the <animate> element, if you give the stop an id, by using the id parameter of the addStop() method, you can use that given id as the value for the otherElem parameter.
gradient = ...
gradient.addStop(id="stop", ...)
gradient.appendAnim(Animate(otherElem="#stop", ...))
Thanks. I'll consider this a bug with the package because you shouldn't be required to use manual ids like that.
I'm going to reopen this issue until I (or someone else) fixes this. The addStop method should return the element it creates so the code I gave works as expected.
alright, many thanks!