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

Fix smearing in Lightness mode

We shoud read smearing data from the coloring layer, not from the
final projection layer.
parent e09c8552
......@@ -18,8 +18,9 @@ void KisColorSmudgeSource::readRect(const QRect &rect) {
/* KisColorSmudgeSourcePaintDevice */
/**********************************************************************************/
KisColorSmudgeSourcePaintDevice::KisColorSmudgeSourcePaintDevice(KisOverlayPaintDeviceWrapper &overlayDevice)
: m_overlayDevice(overlayDevice)
KisColorSmudgeSourcePaintDevice::KisColorSmudgeSourcePaintDevice(KisOverlayPaintDeviceWrapper &overlayDevice, int overlayIndex)
: m_overlayDevice(overlayDevice),
m_overlayIndex(overlayIndex)
{
}
......@@ -28,7 +29,7 @@ void KisColorSmudgeSourcePaintDevice::readRects(const QVector<QRect> &rects) {
}
void KisColorSmudgeSourcePaintDevice::readBytes(quint8 *dstPtr, const QRect &rect) {
m_overlayDevice.overlay()->readBytes(dstPtr, rect);
m_overlayDevice.overlay(m_overlayIndex)->readBytes(dstPtr, rect);
}
const KoColorSpace *KisColorSmudgeSourcePaintDevice::colorSpace() const {
......
......@@ -27,7 +27,7 @@ using KisColorSmudgeSourceSP = QSharedPointer<KisColorSmudgeSource>;
struct KisColorSmudgeSourcePaintDevice : public KisColorSmudgeSource
{
KisColorSmudgeSourcePaintDevice(KisOverlayPaintDeviceWrapper &overlayDevice);
KisColorSmudgeSourcePaintDevice(KisOverlayPaintDeviceWrapper &overlayDevice, int overlayIndex = 0);
void readRects(const QVector<QRect> &rects) override;
......@@ -36,6 +36,7 @@ struct KisColorSmudgeSourcePaintDevice : public KisColorSmudgeSource
private:
KisOverlayPaintDeviceWrapper &m_overlayDevice;
int m_overlayIndex = 0;
};
struct KisColorSmudgeSourceImage : public KisColorSmudgeSource
......
......@@ -67,7 +67,8 @@ void KisColorSmudgeStrategyLightness::initializePainting()
m_heightmapPainter.setSelection(m_initializationPainter->selection());
m_heightmapPainter.copyMirrorInformationFrom(m_initializationPainter);
m_sourceWrapperDevice = toQShared(new KisColorSmudgeSourcePaintDevice(*m_layerOverlayDevice));
// we should read data from the color layer, not from the final projection layer
m_sourceWrapperDevice = toQShared(new KisColorSmudgeSourcePaintDevice(*m_layerOverlayDevice, 1));
}
KisColorSmudgeStrategyBase::DabColoringStrategy &KisColorSmudgeStrategyLightness::coloringStrategy()
......
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