Commit ab53dc16 authored by Ashwin  Dhakaita's avatar Ashwin Dhakaita Committed by Dmitry Kazakov

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

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.

Note from Dmitry Kazakov: setDirty() should be called **after** the
actual device change has been done. Otherwise race condition may happen.

BUG:    403535
FIXED-IN:    krita 4.2.0-pre-alpha (git 0d8b6bd6)
Reviewers: #krita, dkazakov!
Subscribers: dkazakov
Tags: #krita
Differential Revision:
parent d556b73a
...@@ -85,9 +85,14 @@ namespace KisAnimationUtils { ...@@ -85,9 +85,14 @@ namespace KisAnimationUtils {
//shortcut: clearing the image instead //shortcut: clearing the image instead
KisPaintDeviceSP device = node->paintDevice(); KisPaintDeviceSP device = node->paintDevice();
if (device) { if (device) {
const QRect dirtyRect = device->extent();
KisTransaction transaction(kundo2_i18n("Clear"), device,; KisTransaction transaction(kundo2_i18n("Clear"), device,;
device->clear(); device->clear();
(void) transaction.endAndTake(); // saved as 'parent' (void) transaction.endAndTake(); // saved as 'parent'
result = true; result = true;
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment