Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Use subgrid in LiquifyWorker::run()

Agata Cackob2893d4c7a78
diff --git a/libs/image/kis_liquify_transform_worker.cpp b/libs/image/kis_liquify_transform_worker.cpp
index b746cec9fb..aac5348a4a 100644
--- a/libs/image/kis_liquify_transform_worker.cpp
+++ b/libs/image/kis_liquify_transform_worker.cpp
@@ -416,13 +416,19 @@ void KisLiquifyTransformWorker::run(KisPaintDeviceSP srcDevice, KisPaintDeviceSP
dstDevice->clear();
using namespace GridIterationTools;
+ QRect correctSubGrid = calculateCorrectSubGrid(m_d->srcBounds, m_d->pixelPrecision, m_d->accumulatedBrushStrokes, m_d->gridSize);
PaintDevicePolygonOp polygonOp(srcDevice, dstDevice);
RegularGridIndexesOp indexesOp(m_d->gridSize);
iterateThroughGrid<AlwaysCompletePolygonPolicy>(polygonOp, indexesOp,
m_d->gridSize,
m_d->originalPoints,
- m_d->transformedPoints);
+ m_d->transformedPoints,
+ correctSubGrid);
+ QList<QRectF> areasToCopy = cutOutSubgridFromBounds(correctSubGrid, m_d->srcBounds, m_d->gridSize, m_d->originalPoints);
+ for (int i = 0; i < areasToCopy.length(); i++) {
+ polygonOp.fastCopyArea(areasToCopy[i]);
+ }
}
QRect KisLiquifyTransformWorker::approxChangeRect(const QRect &rc)