Fixed canvas isn't cleared when adding a new blank frame
ClosedPublic

Authored by ashwind on Wed, Feb 6, 4:00 PM.

Details

Summary

When create blank frame is clicked on animation docker having a keyframe selected, that is not the last frame in the timeline, the canvas is not cleared properly.

BUG: 403535
FIXED-IN: krita 4.2.0-pre-alpha (git 0d8b6bd)

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ashwind created this revision.Wed, Feb 6, 4:00 PM
Restricted Application added a reviewer: Krita. · View Herald TranscriptWed, Feb 6, 4:00 PM
ashwind requested review of this revision.Wed, Feb 6, 4:00 PM
dkazakov added a subscriber: dkazakov.

The setDirty() call should happen somewhere at the higher level. I guess there was some code for it. I'll check later today.

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Feb 8, 8:51 AM
This revision was automatically updated to reflect the committed changes.

I have pushed the fix with a minor change: setDirty() should always be called after the change has been done, not before that. Otherwise the patch was correct. Looks like I dropped the update part when refactoring this code to the strokes framework :)

Ok thanks. It almost drew me crazy.

actually the setdirty call wasnt working outside the lambda command. So i was a bit confused about calling it a from a higher level.

actually the setdirty call wasnt working outside the lambda command. So i was a bit confused about calling it a from a higher level.

Yes, because lambda is called from the context of the worker thread asynchronously. Much later, that the command itself is created.

Usually, we delegate doing updates to the KisProcessingApplicator, or some undo commands. See rootNode parameter of KisProcessingApplicator and KisKeyframeChannel::requestUpdate(). The latter one is supposed to be used in the undo commands of animation-related code, but it looks like it is not applicable here...

Yeah I actually got that far yesterday. Stepping through the code, but wasnt sure if that is actually the thing.

Thanks :))