-
Notifications
You must be signed in to change notification settings - Fork 286
Fix #1873 - Fix frame not being drawn on the timeline #1887
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
Merged
chchwy
merged 4 commits into
pencil2d:release/0.7.1
from
MrStevns:bugfix/0.7.1/iss-1873-frame-disappear
Jun 5, 2025
Merged
Fix #1873 - Fix frame not being drawn on the timeline #1887
chchwy
merged 4 commits into
pencil2d:release/0.7.1
from
MrStevns:bugfix/0.7.1/iss-1873-frame-disappear
Jun 5, 2025
Conversation
This file contains hidden or 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
70bb143
to
15cea44
Compare
15cea44
to
5c76ddc
Compare
Totally agree with you about removing "isSelected" from Keyframe. |
chchwy
reviewed
Jun 3, 2025
5c76ddc
to
c432411
Compare
chchwy
reviewed
Jun 5, 2025
chchwy
approved these changes
Jun 5, 2025
Apart from the clean up mentioned above, I don't have further questions. Thanks and well done @MrStevns |
The reason for this is that while we keep a list of keyframes to move and paint keyframes on the timeline, a keyframe also has its own "isSelected" state. This state is backed up through undo/redo operations which the layer::getSelectedFrames is not. The solution is to remove isSelected from Keyframe, as there should only be one truth.
f544e0b
to
5615584
Compare
chchwy
pushed a commit
that referenced
this pull request
Jun 5, 2025
* AC-1873 - Fix frame not being drawn on the timeline The reason for this is that while we keep a list of keyframes to move and paint keyframes on the timeline, a keyframe also has its own "isSelected" state. This state is backed up through undo/redo operations which the layer::getSelectedFrames is not. The solution is to remove isSelected from Keyframe, as there should only be one truth. * Only deselect layer if the index has changed * TimeLineCells: Use ForEach and return * Cleanup unused function
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The reason for this is that while we keep a list of selected keyframes to move and paint on the timeline, a keyframe also has its own "isSelected" state. This state is backed up through undo/redo operations while the layer::getSelectedFrames is not.
We use the isSelected state to ignore selected frames in the TimeLineCells::paintFrames while we use Layer::getSelectedFrames() to paint the selected frames.
This means that we can get into a situation where the frame is neither painted as selected nor non selected because of the two different sources of truth.
The solution is to remove one of the sources. As such, I went ahead and removed isSelected from Keyframe, so there's only one truth. By doing so, said frames can no longer be put in a selected state through undo/redo operations, which I personally think is good. I've inspected a few other applications which does also not keep selections as undo/redo'able state.
There's also the benefit that we don't have to iterate through all frames to know which is selected.
To that end my conclusion is that we shouldn't have to do that either.
fixes #1873