Skip to content
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

Feature/iss 748 - undo redo keyframes #1885

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

MrStevns
Copy link
Member

@MrStevns MrStevns commented Oct 19, 2024

This PR adds the following to the new undo/redo system:

  • Adding keyframes
  • Deleting keyframes
  • Moving keyframes

In addition I had to make some changes to the structure of UndoRedoManager, as it wasn't as flexible as I liked it to be. The result of this means you can now add additional state changes to the UndoSaveState once it has been created. This is for example used to add data which is proprietary to the TimeLineCells and can therefore not be fetched from within the state methods of UndoRedoManager. When this is done however, the state should be struct references and not pointers... because we don't want to deal with too much ptr deletion, if any...

I've also introduced a set of guards to avoid dealing with an undo/redo stack that is potentially gone, for example when you delete the layer where there were once keyframes.
Since we don't support that yet, we have to guard against it to avoid crashing.

The way it works is that the the undo command becomes obsolete in those cases and can no longer be accessed on the undo stack.

closes #748

To avoid memory leaks when calling createState too many times, without applying the state
This is a temporary issue that will be obsolete once we support restoring the layer state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

Allow to UNDO / REDO "deleting" new frames and layers
1 participant