diff --git a/plugins/tools/tool_transform2/kis_cage_transform_strategy.cpp b/plugins/tools/tool_transform2/kis_cage_transform_strategy.cpp --- a/plugins/tools/tool_transform2/kis_cage_transform_strategy.cpp +++ b/plugins/tools/tool_transform2/kis_cage_transform_strategy.cpp @@ -47,6 +47,8 @@ overrideDrawingItems(true, false, true); setCloseOnStartPointClick(true); setClipOriginalPointsPosition(false); + setTransformType("cage"); + } KisCageTransformStrategy::~KisCageTransformStrategy() diff --git a/plugins/tools/tool_transform2/kis_warp_transform_strategy.h b/plugins/tools/tool_transform2/kis_warp_transform_strategy.h --- a/plugins/tools/tool_transform2/kis_warp_transform_strategy.h +++ b/plugins/tools/tool_transform2/kis_warp_transform_strategy.h @@ -43,6 +43,8 @@ ~KisWarpTransformStrategy() override; void setTransformFunction(const QPointF &mousePos, bool perspectiveModifierActive) override; + void setTransformType(QString type); + void paint(QPainter &gc) override; QCursor getCurrentCursor() const override; diff --git a/plugins/tools/tool_transform2/kis_warp_transform_strategy.cpp b/plugins/tools/tool_transform2/kis_warp_transform_strategy.cpp --- a/plugins/tools/tool_transform2/kis_warp_transform_strategy.cpp +++ b/plugins/tools/tool_transform2/kis_warp_transform_strategy.cpp @@ -97,6 +97,9 @@ QPointF lastMousePos; + // cage transform also uses this logic. This helps this class know what transform type we are using + QString transformType = "warp"; + void recalculateTransformations(); inline QPointF imageToThumb(const QPointF &pt, bool useFlakeOptimization); @@ -199,6 +202,10 @@ m_d->clipOriginalPointsPosition = value; } +void KisWarpTransformStrategy::setTransformType(QString type) { + m_d->transformType = type; +} + void KisWarpTransformStrategy::drawConnectionLines(QPainter &gc, const QVector &origPoints, const QVector &transfPoints, @@ -316,8 +323,9 @@ } - // draw grid lines only if we are using the GRID mode. - if (m_d->currentArgs.warpCalculation() == KisWarpTransformWorker::WarpCalculation::GRID) { + // draw grid lines only if we are using the GRID mode. Also only use this logic for warp, not cage transforms + if (m_d->currentArgs.warpCalculation() == KisWarpTransformWorker::WarpCalculation::GRID && + m_d->transformType == "warp" ) { // see how many rows we have. we are only going to do lines up to 6 divisions/ // it is almost impossible to use with 6 even.