I have a drawing application that uses fabric.js and I have implemented an undo/redo function based on the fabric-history repository on github. However, because this approach saves entire canvas states in a stack, the browser quickly becomes non-responsive as it deals with all this data. I would like an undo/redo method that only saves the object that is changed in an interaction with an object on the canvas and not the whole canvas. Using the object:modified event, I see I can get the target object of the event after it is modified, but I also need the object target state before the modification was made to restore it in an undo. Any suggestions on how to obtain this state of an object would be appreciated.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.