-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce new Undo/Redo system #1817
Conversation
Also add a guard to make sure that saveStates doesn't do anything while we use the old system.
Also removed an unused reference
b00d582
to
a52e346
Compare
Since we're always drawing the backbuffer, the logic gates are redundant.
ec7050c
to
8bf0866
Compare
Co-authored-by: Jakob <[email protected]>
Co-authored-by: Jakob <[email protected]>
Co-authored-by: Jakob <[email protected]>
It's no longer possible to call add without having a valid save state. This makes it easier to see where the state comes from as well as allowing you to keep multiple save states at the same time.
Co-authored-by: Jakob <[email protected]>
Which resulted in isFirstRedo being ignored
96d9041
to
7dac960
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. Looks all good to me now. Only Matt’s and scribble’s reviews pending now.
@@ -56,7 +56,7 @@ class BitmapReplaceCommand : public UndoRedoCommand | |||
|
|||
public: | |||
BitmapReplaceCommand(const BitmapImage* backupBitmap, | |||
int backupLayerId, | |||
const int undoLayerId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB const for scalar parameters is only relevant in the definition and meaningless in the declaration.
This pull request is a priority for the upcoming v0.8.0 release. Sorry, I've been really busy lately. I'll go through and approve the PR soon. |
I will be merging this PR, thanks for the tremendous effort to implement this! @MrStevns |
This PR introduces a new backup system, aka. the undo/redo system that I've tried to introduce a bunch of times over a few years but never completed or completed but was too big to actually review properly 🙃
What's different about this PR is that everything but backups for strokes and polyline has been scrapped.
Won't that leave us with a less feature complete undo/redo system then, you ask? No, because the old system still exist, basically we can switch between the old and the new system, while we continue to develop it.
Some benefits of that is:
In addition to that, in order to avoid leaking the complexity of having two backup systems, all the backup system logic exist in the same place. As such everything including the old system reside now in backupmanager.cpp/h files. The old backup system will work as is and still call editor, which now just redirect it to backup manager but otherwise it's the same.
For simplicity sake and to avoid all kinds of weird edge cases, once the new undo manager has been activated, you'll need to restart the application, same goes for when you deactivate it.
There's still a bit of work before the PR is ready to be reviewed, mainly getting selection modifications working again and some cleanup.