Open rupl opened 9 years ago
I think the best bet here would be to wrap elements in a parent when they're grouped. all transform data is preserved, and the new group's bounding box should be simple to calculate based on the transforms at the time of grouping.
Grouping groups might be possible too.. just set the event listeners to only ever care about the top-most element (must be a direct child of #canvas
. Once a shape or group is a child of anything else, it no longer can be individually altered.
two.js does grouping and we can move shapes into a group using their API.
Another library: https://daybrush.com/moveable/release/latest/doc/
Similar to photoshop layers. Bonus points for being able to clone a group.