Open unitycoder opened 5 years ago
try with simple Stack like here https://github.com/unitycoder/PixelArtTool/blob/131c381ca66a8b9da170e338456031d60539484b/PixelArtTool/MainWindow.xaml.cs#L41 then search for those undoStack and redoStack variables to see how its done, used only in couple places. The idea is that when you call undo, that undo buffer is moved into redoStack, and if you redo, its moved to undostack.
for mobilepaint, would use byte[] instead of that writeablebitmap there.
try with simple Stack like here https://github.com/unitycoder/PixelArtTool/blob/131c381ca66a8b9da170e338456031d60539484b/PixelArtTool/MainWindow.xaml.cs#L41 then search for those undoStack and redoStack variables to see how its done, used only in couple places. The idea is that when you call undo, that undo buffer is moved into redoStack, and if you redo, its moved to undostack.
for mobilepaint, would use byte[] instead of that writeablebitmap there.