Feature pull request: Mutable SVG object in runtime
I modify your code to make the SVG mutable, Including:
- public your svg tag classes and value type class (user may new and modify from outside)
- add saveSVGState and restoreSVGState (like push and pop), restoreOriginalSVGState (Like openGL load identity) etc.
Please take a look.
I followed you from GoogleCode. You said you will parse it to DOM-tree, I dunno if it is still on. But may be you can accept this first and let people do these things first. After you finish the DOM-tree implementation, you can level up your version to 2.x.x
Hi. Thanks for posting this. This is an interesting patch. I'm curious how you are using these changes yourself. What is it enabling you to do that you couldn't do before?
I have 2 major usage:
- Change color in runtime
- Draw only specified group with "display" attribute (so that I can draw sprite with common
in different frame. Imagine that how u make a gif animation by enabling various layers in different frame)
After the change is set, I render the SVG object into picture, then restore original SVG state and the another change, and so on.
But the code is not thoroughly tested. I only use it with some tags I've used. You'd better test the code more with your own test case. :P
This is definitely stale, but it would still be a useful feature. CSS customization is an option, but a very limited one. Mutable SVG objects could potentially provide much more flexibiltiy, along with a more natural programmatic way of doing so (as opposed to css strings).