Commit c4a515a8 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Recreate a default bounds object on every KisMask::setImage() call

Basically, default bounds objects may be shared among multiple objects
so changing it is not safe.

CCBUG:345619
parent 11a38dca
......@@ -47,11 +47,6 @@ KisDefaultBounds::~KisDefaultBounds()
delete m_d;
}
void KisDefaultBounds::setImage(KisImageWSP image)
{
m_d->image = image;
}
QRect KisDefaultBounds::bounds() const
{
/**
......
......@@ -37,8 +37,6 @@ public:
KisDefaultBounds(KisImageWSP image = 0);
virtual ~KisDefaultBounds();
void setImage(KisImageWSP image);
QRect bounds() const;
bool wrapAroundMode() const;
......
......@@ -95,11 +95,9 @@ KisMask::~KisMask()
void KisMask::setImage(KisImageWSP image)
{
KisDefaultBoundsBaseSP db = m_d->selection->pixelSelection()->defaultBounds();
KisDefaultBounds *defaultBounds = dynamic_cast<KisDefaultBounds*>(db.data());
if (defaultBounds) {
defaultBounds->setImage(image);
}
KisPaintDeviceSP parentPaintDevice = parent() ? parent()->original() : 0;
KisDefaultBoundsBaseSP defaultBounds = new KisSelectionDefaultBounds(parentPaintDevice, image);
m_d->selection->setDefaultBounds(defaultBounds);
}
bool KisMask::allowAsChild(KisNodeSP node) 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