Skip to content

Move isFirstRedo state to undo manager#2017

Open
MrStevns wants to merge 1 commit into
pencil2d:masterfrom
MrStevns:undo-redo-first-redo-fix
Open

Move isFirstRedo state to undo manager#2017
MrStevns wants to merge 1 commit into
pencil2d:masterfrom
MrStevns:undo-redo-first-redo-fix

Conversation

@MrStevns

@MrStevns MrStevns commented Jun 14, 2026

Copy link
Copy Markdown
Member

Because it causes issues that each undo/redo command owns the isFirstRedo when parent is ignored. The consequence of this is that later when the you perform a redo that triggers a child command, the command will be ignored because it hasn't been called previously.

To recap why we do this:
QUndoCommand works in the way where pushing a command onto the stack, triggers redo immediately and that doesn't work with our current architecture, so to prevent triggering the same action twice, we skip the first redo.

Because it causes issues that each undo/redo command owns the isFirstRedo when parent is ignored and thus doesn't trigger redo on the child.
@MrStevns MrStevns changed the title Move isFirstRedo to undo manager Move isFirstRedo state to undo manager Jun 14, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

1 participant