-
Notifications
You must be signed in to change notification settings - Fork 293
Closed
Description
Issue Summary
Undoing a frame deletion can cause two actions to be undone, or a crash in some situations. This is likely the same issue as #843, although the steps to reproduce are more involved.
Steps to reproduce
- Create a new project.
- Create a layer with at least two keyframes.
- Delete the first keyframe. If you are using a bitmap layer, the first keyframe must be at a position > 1.
- Undo the frame deletion. This will undo the frame deletion and the action before that, or it will crash if no other undoable actions were performed.
System Information
-
Pencil2D Version: 6f0b75b, v0.6.5
-
Operating System: Ubuntu 20.04
-
RAM Size: 16 GB
-
Graphics Tablet: N/A
Developer Notes
This crash is happening when Editor::backup is called before reverting the deletion. In that function it uses getLast*ImageAtFrame, which returns null if there isn't a previous frame. If it's null, the backup is skipped, however Editor::undo always decrements mBackupIndex whether or not the backup was successful. Thus it goes back two actions instead of one, or causes an out of bounds exception if it goes below 0.
Metadata
Metadata
Assignees
Type
Projects
Status
No status