Commit b3c150e2 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Make sure that fake original() of KisFileLayer has defaultBounds() set

Before KisFileLayer loaded its image (or when the image is not
available), file layer uses a fake paint device. This paint device
should also have proper default bounds set.

CCBUG:412361
parent a1c74034
......@@ -43,6 +43,8 @@ KisFileLayer::KisFileLayer(KisImageWSP image, const QString &name, quint8 opacit
* in the failing execution path.
*/
m_paintDevice = new KisPaintDevice(image->colorSpace());
m_paintDevice->setDefaultBounds(new KisDefaultBounds(image));
connect(&m_loader, SIGNAL(loadingFinished(KisPaintDeviceSP,int,int)), SLOT(slotLoadingFinished(KisPaintDeviceSP,int,int)));
}
......@@ -58,6 +60,7 @@ KisFileLayer::KisFileLayer(KisImageWSP image, const QString &basePath, const QSt
* in the failing execution path.
*/
m_paintDevice = new KisPaintDevice(image->colorSpace());
m_paintDevice->setDefaultBounds(new KisDefaultBounds(image));
connect(&m_loader, SIGNAL(loadingFinished(KisPaintDeviceSP,int,int)), SLOT(slotLoadingFinished(KisPaintDeviceSP,int,int)));
......@@ -250,3 +253,9 @@ KUndo2Command* KisFileLayer::transform(const QTransform &/*transform*/)
return 0;
}
void KisFileLayer::setImage(KisImageWSP image)
{
m_paintDevice->setDefaultBounds(new KisDefaultBounds(image));
KisExternalLayer::setImage(image);
}
......@@ -84,6 +84,8 @@ public:
KUndo2Command* crop(const QRect & rect) override;
KUndo2Command* transform(const QTransform &transform) override;
void setImage(KisImageWSP image) override;
public Q_SLOTS:
void slotLoadingFinished(KisPaintDeviceSP projection, int xRes, int yRes);
......
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