-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce new Undo/Redo system (#1817)
* Implement ability to switch between old and new backup system * Remove anything but the most essential logic * Make it more obvious that we're calling the legacy system * Make sure we always update the save counter * Change feature dialog text * Add another dialog when re-enabling the old system * Apply more cleanup before restructuring * Refactor backupManager * Introduce the new backup system to stroke tools and polyline. Also add a guard to make sure that saveStates doesn't do anything while we use the old system. * Add backup for smudge tool * Remove commented code * Update license snips * Fix tests crashing * Add missing MOC for backupmanager for Qt 6 compatibility Also removed an unused reference * Change argument type for layer bitmap/vector * Calling backupmanager backup should be noop for when not activated * Fix vector selection not being painted immediately during undo/redo * Simplify CanvasPainter::paintCurrentFrame logic Since we're always drawing the backbuffer, the logic gates are redundant. * Fix rotation would jump when using undo/redo and trying to modify again * Re-enable selection backups * Do some spring cleaning in BackupManager * Remove use of ptr's, so we don't have to deal with memory freeing. * Remove redundant member variables Since the keyframe already contains the frame pos, there's no reason to keep a second value which could lead to bugs in the future. * Replace replaceLastFoo in favour of a generic replaceKeyFrame method * Fix some issues and housekeeping etc. * Attempt to fix CI-only build failure * Fix legacy undo/redo actions being enabled following startup * Remove superfluous delete * Fix undo/redo system being broken Caused by a brainfart in the evening... * Remove redundant methods in backupelement * Remove id in backupelement Used for compressing backup events, which is currently not implemented. * Add unreachable check to TransformElement * Use QUndoStack clean instead if checking the backupElement ptr * Refactor replaceKeyFrame, should use getXAtFrame instead of getLast * Prevent use of a saved undo state more than once Also fixed memory leak situation with clone not being cleaned up later. * Rename BackupElements -> old/new to undo/redo * Refactor Backup terminology to UndoCommand terminology * Remove undo/redo prefix when using new undo/redo system * TransformCommand: split undo/redo keyframe resolving * Fix old backupmanager references * Implement ability to set undo/redo steps And set default to 100 steps. * Change QUndoStack from ptr to object * Update core_lib/src/managers/undoredomanager.cpp Co-authored-by: Jakob <[email protected]> * Update app/src/generalpage.cpp Co-authored-by: Jakob <[email protected]> * Update app/ui/generalpage.ui Co-authored-by: Jakob <[email protected]> * Fix changes individual undo/redo setting would disable buttons. * Add newline for easier readability * Rework how undo save state should be used 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. * Simplify UndoRedoManager::add * Update core_lib/src/managers/undoredomanager.cpp Co-authored-by: Jakob <[email protected]> * Fix transform command children would not be called the first time Which resulted in isFirstRedo being ignored * Rename Undo commands to be more specific * Rewrite how state is recorded and saved temporarily. * Rename saveStates -> state * Use layerType from save state rather than current layer * UndoRedoManager: Improve assert description --------- Co-authored-by: Jakob Gahde <[email protected]> Co-authored-by: Matt Chia-wen Chang <[email protected]>
- Loading branch information
1 parent
09ef787
commit 3d0a148
Showing
40 changed files
with
1,600 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.