benjamminf / warpjs

Warp, distort, bend, twist and smudge your SVG’s directly in the browser
https://benjamminf.github.io/warpjs
MIT License
486 stars 34 forks source link

More control for modifying SVG's while warping #8

Closed benjamminf closed 3 years ago

benjamminf commented 7 years ago

At the moment, warping an SVG will essentially lock it's shapes and paths to whatever was there before passing it to warp.js. While possible, it's not easy to do certain things such as adding new shapes to a warped SVG, while removing them results in a memory leak.

New shapes should be normalised and added to the internal path data, while removed shapes should be discarded from the path data. Perhaps a refresh() method could query the SVG for all it's elements and compare it to what's in the path data?