abey79/vsvg

Mutability of Path/Layer/Document

abey79 opened this issue · 3 comments

For operations on Path/Layer/Document structures (e.g. transforms, crop, etc.), I'm using for the moment an immutable pattern (e.g. fn ops(self, ...) -> Self {}), though clearly the goal is not to have purely immutable structure (e.g. paths addition/removal in layers, layer addition/removal in document, etc.). I'm not sure yet of the implication and if this is a good idea or not.

Lots of implementation details are getting tedious with this approach, especially around the drawing and mutation from commands such as --translate & friends.

b5e49c2 departs from the pseudo-immutable API.

abey79 commented

There is no going back from mutability, whiskers heavily depends on it.