I'm writing a kind of vector editor using fabric.js. I need to implement a history with undo (and probably redo) option for a small subset of modifications. So I'm using the 'object:modified' event for that purpose. It works perfect when I do something with a single object, but when it comes to a selection I have a problem.
I have an array of user actions. If the user moved the figure, I write the object to that array with figure Id, and previous position to restore it on clicking undo. But if the user moved several selected objects it happens with activeSelection. And if I want to keep my scheme, I have to split the selection to several figures and store position for each of them.
Are there any other options? How do you usually deal with multiple objects?