8#include <QElapsedTimer>
32 QScopedPointer<KisLiquifyPaintop>
paintOp;
70 m_d->previousPaintInfo.registerDistanceInformation(&
m_d->previousDistanceInfo);
85 m_d->strokeTime.start();
87 m_d->infoBuilder->startStroke(event,
m_d->strokeTime.elapsed(), manager);
89 m_d->updatePreviousPaintInfo(pi);
90 m_d->hasPaintedAtLeastOnce =
false;
98 m_d->infoBuilder->continueStroke(event,
m_d->strokeTime.elapsed());
101 m_d->previousPaintInfo,
103 &
m_d->currentDistance,
106 m_d->updatePreviousPaintInfo(pi);
107 m_d->hasPaintedAtLeastOnce =
true;
114 if (!
m_d->hasPaintedAtLeastOnce) {
116 m_d->infoBuilder->continueStroke(event,
m_d->strokeTime.elapsed());
118 pi.
paintAt(*
m_d->paintOp.data(), &
m_d->previousDistanceInfo);
121 m_d->paintOp.reset();
123 return !
m_d->hasPaintedAtLeastOnce;
128 QPointF imagePoint =
m_d->converter->documentToImage(event->
pos());
131 m_d->updatePreviousPaintInfo(pi);
qreal effectiveZoom() const
const QScopedPointer< Private > m_d
QPainterPath brushOutline(const KisLiquifyProperties &props)
void continuePaint(KoPointerEvent *event)
void startPaint(KoPointerEvent *event, const KoCanvasResourceProvider *manager)
void configurePaintOp(const KisLiquifyProperties &_props, KisLiquifyTransformWorker *worker)
void hoverPaint(KoPointerEvent *event)
bool endPaint(KoPointerEvent *event)
KisLiquifyPaintHelper(const KisCoordinatesConverter *converter)
static QPainterPath brushOutline(const KisLiquifyProperties &props, const KisPaintInformation &info)
QPointF pushThroughHistory(const QPointF &pt, qreal zoom)
QPoint pos() const
return the position in widget coordinates
#define KIS_ASSERT_RECOVER(cond)
#define KIS_ASSERT_RECOVER_RETURN(cond)
qreal directionBetweenPoints(const QPointF &p1, const QPointF &p2, qreal defaultAngle)
void paintLine(PaintOp &op, const KisPaintInformation &pi1, const KisPaintInformation &pi2, KisDistanceInformation *currentDistance, bool fanCornersEnabled, qreal fanCornersStep)
KisPaintInformation previousPaintInfo
QScopedPointer< KisPaintingInformationBuilder > infoBuilder
Private(const KisCoordinatesConverter *_converter)
QScopedPointer< KisLiquifyPaintop > paintOp
KisDistanceInformation previousDistanceInfo
void updatePreviousPaintInfo(const KisPaintInformation &info)
const KisCoordinatesConverter * converter
KisPaintOpUtils::PositionHistory lastOutlinePos
bool hasPaintedAtLeastOnce
KisDistanceInformation currentDistance