Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/tool/kis_tool_freehand_helper.cpp
Context not available. | |||||
50 | // airbrush rate, which can improve responsiveness. | 50 | // airbrush rate, which can improve responsiveness. | ||
---|---|---|---|---|---|
51 | const qreal AIRBRUSH_INTERVAL_FACTOR = 0.5; | 51 | const qreal AIRBRUSH_INTERVAL_FACTOR = 0.5; | ||
52 | 52 | | |||
53 | // The amount of time, in milliseconds, to allow between updates of the spacing information. Only | ||||
54 | // used when airbrushing. | ||||
55 | const qreal SPACING_UPDATE_INTERVAL = 50.0; | ||||
56 | | ||||
53 | struct KisToolFreehandHelper::Private | 57 | struct KisToolFreehandHelper::Private | ||
54 | { | 58 | { | ||
55 | KisPaintingInformationBuilder *infoBuilder; | 59 | KisPaintingInformationBuilder *infoBuilder; | ||
Context not available. | |||||
266 | 270 | | |||
267 | m_d->previousPaintInformation = pi; | 271 | m_d->previousPaintInformation = pi; | ||
268 | 272 | | |||
273 | KisDistanceInitInfo startDistInfo(m_d->previousPaintInformation.pos(), | ||||
274 | m_d->previousPaintInformation.currentTime(), | ||||
275 | startAngle, | ||||
276 | SPACING_UPDATE_INTERVAL); | ||||
277 | KisDistanceInformation startDist = startDistInfo.makeDistInfo(); | ||||
278 | | ||||
269 | createPainters(m_d->painterInfos, | 279 | createPainters(m_d->painterInfos, | ||
270 | m_d->previousPaintInformation.pos(), | 280 | startDist); | ||
271 | m_d->previousPaintInformation.currentTime(), | | |||
272 | startAngle); | | |||
273 | 281 | | |||
274 | m_d->resources = new KisResourcesSnapshot(image, | 282 | m_d->resources = new KisResourcesSnapshot(image, | ||
275 | currentNode, | 283 | currentNode, | ||
Context not available. | |||||
281 | } | 289 | } | ||
282 | 290 | | |||
283 | if(m_d->recordingAdapter) { | 291 | if(m_d->recordingAdapter) { | ||
284 | m_d->recordingAdapter->startStroke(image, m_d->resources); | 292 | m_d->recordingAdapter->startStroke(image, m_d->resources, startDistInfo); | ||
285 | } | 293 | } | ||
286 | 294 | | |||
287 | KisStrokeStrategy *stroke = | 295 | KisStrokeStrategy *stroke = | ||
Context not available. | |||||
916 | } | 924 | } | ||
917 | 925 | | |||
918 | void KisToolFreehandHelper::createPainters(QVector<PainterInfo*> &painterInfos, | 926 | void KisToolFreehandHelper::createPainters(QVector<PainterInfo*> &painterInfos, | ||
919 | const QPointF &lastPosition, | 927 | const KisDistanceInformation &startDist) | ||
920 | int lastTime, | | |||
921 | qreal lastAngle) | | |||
922 | { | 928 | { | ||
923 | painterInfos << new PainterInfo(lastPosition, lastTime, lastAngle); | 929 | painterInfos << new PainterInfo(startDist); | ||
924 | } | 930 | } | ||
925 | 931 | | |||
926 | void KisToolFreehandHelper::paintAt(const KisPaintInformation &pi) | 932 | void KisToolFreehandHelper::paintAt(const KisPaintInformation &pi) | ||
Context not available. |