Open ghost opened 10 years ago
I couldn't implement this when i was writing that because of the huge redrawing queue. Essentially to undo we would have to redraw the entire image, which requires representing the entire path in memory. I figured this was too much of a performance cost for the gain. If you guys have an alternate implementation, im open to suggestions.
Hmm, yeah, interesting problem. Right now we represent the thing as a state machine that can only go forwards, so it's not simple to just undo one command.
The one possibility is representing an inverse operation of draw. e.g., inverse of draw path from A->B is erase from B->A. Maybe this could get messy if you were trying to undo just your own changes (vs. the global state of your changes interwoven with others' changes)
Even that wouldn't really work, because say you draw an X, and then delete the overlapping line. An erasing technique would leave you with 2 diagonal dashes with a small space in the middle.
True, so perhaps the only thing to do would be to replay the animations with the set of undo'd items removed. Perhaps there's a smarter approach
I was drawing with friends there are were so many times an undo button would have saved our picture.