Commit 250d243d authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix selection default bounds when loading old type of adjustment layers

This possibly fixes KisDoc2Test on Jenkins
parent 9c152b56
......@@ -224,6 +224,7 @@ void KisSelectionBasedLayer::setInternalSelection(KisSelectionSP selection)
if (selection) {
m_d->selection = new KisSelection(*selection.data());
m_d->selection->setParentNode(this);
m_d->selection->setDefaultBounds(new KisDefaultBounds(image()));
m_d->selection->updateProjection();
KisPixelSelectionSP pixelSelection = m_d->selection->pixelSelection();
......@@ -232,20 +233,19 @@ void KisSelectionBasedLayer::setInternalSelection(KisSelectionSP selection)
enableAnimation();
}
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());
}
} else {
m_d->selection = 0;
}
KisImageSP imageSP = image().toStrongRef();
if (!imageSP) {
return;
}
if (selection->pixelSelection()->defaultBounds()->bounds() != imageSP->bounds()) {
qWarning() << "WARNING: KisSelectionBasedLayer::setInternalSelection"
<< "New selection has suspicious default bounds";
qWarning() << "WARNING:" << ppVar(selection->pixelSelection()->defaultBounds()->bounds());
qWarning() << "WARNING:" << ppVar(imageSP->bounds());
}
}
qint32 KisSelectionBasedLayer::x() const
......
Markdown is supported
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