Commit ed757644 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix an assert when copy/paste a filter layer

CCBUG:458115


(cherry picked from commit 8a1e5920)
parent 5df0cc57
Pipeline #232994 canceled with stage
in 28 seconds
......@@ -109,6 +109,8 @@ void KisSelectionBasedLayer::setImage(KisImageWSP image)
if (image) {
m_d->imageConnections.addConnection(image.data(), SIGNAL(sigSizeChanged(QPointF,QPointF)), this, SLOT(slotImageSizeChanged()));
}
resetCache();
}
bool KisSelectionBasedLayer::allowAsChild(KisNodeSP node) const
......@@ -235,13 +237,16 @@ void KisSelectionBasedLayer::setInternalSelection(KisSelectionSP selection)
}
KisImageSP imageSP = image().toStrongRef();
KIS_SAFE_ASSERT_RECOVER_RETURN(imageSP);
if (m_d->selection->pixelSelection()->defaultBounds()->bounds() != imageSP->bounds()) {
qWarning() << "WARNING: KisSelectionBasedLayer::setInternalSelection"
<< "New selection has suspicious default bounds";
qWarning() << "WARNING:" << ppVar(m_d->selection->pixelSelection()->defaultBounds()->bounds());
qWarning() << "WARNING:" << ppVar(imageSP->bounds());
if (imageSP) {
/**
* Sanity check for the case when the image is present
*/
if (m_d->selection->pixelSelection()->defaultBounds()->bounds() != imageSP->bounds()) {
qWarning() << "WARNING: KisSelectionBasedLayer::setInternalSelection"
<< "New selection has suspicious default bounds";
qWarning() << "WARNING:" << ppVar(m_d->selection->pixelSelection()->defaultBounds()->bounds());
qWarning() << "WARNING:" << ppVar(imageSP->bounds());
}
}
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment