Changeset View
Changeset View
Standalone View
Standalone View
libs/image/kis_merge_walker.cc
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 40 | { | |||
---|---|---|---|---|---|
48 | 48 | | |||
49 | KisProjectionLeafSP prevLeaf = startLeaf->prevSibling(); | 49 | KisProjectionLeafSP prevLeaf = startLeaf->prevSibling(); | ||
50 | if(prevLeaf) | 50 | if(prevLeaf) | ||
51 | visitLowerNode(prevLeaf); | 51 | visitLowerNode(prevLeaf); | ||
52 | } | 52 | } | ||
53 | 53 | | |||
54 | void KisMergeWalker::startTripWithMask(KisProjectionLeafSP filthyMask) | 54 | void KisMergeWalker::startTripWithMask(KisProjectionLeafSP filthyMask) | ||
55 | { | 55 | { | ||
56 | if (!filthyMask->parent()) { | | |||
57 | /** | 56 | /** | ||
58 | * Under very rare circumstances it may happen that the update | 57 | * Under very rare circumstances it may happen that the update | ||
59 | * queue will contain a job pointing to a node that has | 58 | * queue will contain a job pointing to a node that has | ||
60 | * already been deleted from the image (direclty or by undo | 59 | * already been deleted from the image (direclty or by undo | ||
61 | * command). If it happens to a layer then the walker will | 60 | * command). If it happens to a layer then the walker will | ||
62 | * handle it as usual by building a trivial graph pointing to | 61 | * handle it as usual by building a trivial graph pointing to | ||
63 | * nowhere, but when it happens to a mask... not. Because the | 62 | * nowhere, but when it happens to a mask... not. Because the | ||
64 | * mask is always expected to have a parent layer to process. | 63 | * mask is always expected to have a parent layer to process. | ||
65 | * | 64 | * | ||
66 | * So just handle it here separately. | 65 | * So just handle it here separately. | ||
67 | */ | 66 | */ | ||
68 | 67 | KisProjectionLeafSP parentLayer = filthyMask->parent(); | |||
68 | if (!parentLayer) { | ||||
69 | return; | 69 | return; | ||
70 | } | 70 | } | ||
71 | 71 | | |||
72 | adjustMasksChangeRect(filthyMask); | 72 | adjustMasksChangeRect(filthyMask); | ||
73 | 73 | | |||
74 | KisProjectionLeafSP parentLayer = filthyMask->parent(); | | |||
75 | Q_ASSERT(parentLayer); | | |||
76 | | ||||
77 | KisProjectionLeafSP nextLeaf = parentLayer->nextSibling(); | 74 | KisProjectionLeafSP nextLeaf = parentLayer->nextSibling(); | ||
78 | KisProjectionLeafSP prevLeaf = parentLayer->prevSibling(); | 75 | KisProjectionLeafSP prevLeaf = parentLayer->prevSibling(); | ||
79 | 76 | | |||
80 | if (nextLeaf) | 77 | if (nextLeaf) | ||
81 | visitHigherNode(nextLeaf, N_ABOVE_FILTHY); | 78 | visitHigherNode(nextLeaf, N_ABOVE_FILTHY); | ||
82 | else if (parentLayer->parent()) | 79 | else if (parentLayer->parent()) | ||
83 | startTrip(parentLayer->parent()); | 80 | startTrip(parentLayer->parent()); | ||
84 | 81 | | |||
Show All 34 Lines |