Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/tool/kis_tool_freehand_helper.cpp
| Show First 20 Lines • Show All 580 Lines • ▼ Show 20 Line(s) | 555 | { | |||
|---|---|---|---|---|---|
| 581 | } | 581 | } | ||
| 582 | } | 582 | } | ||
| 583 | else if (m_d->smoothingOptions->smoothingType() == KisSmoothingOptions::NO_SMOOTHING){ | 583 | else if (m_d->smoothingOptions->smoothingType() == KisSmoothingOptions::NO_SMOOTHING){ | ||
| 584 | paintLine(m_d->previousPaintInformation, info); | 584 | paintLine(m_d->previousPaintInformation, info); | ||
| 585 | } | 585 | } | ||
| 586 | 586 | | |||
| 587 | if (m_d->smoothingOptions->smoothingType() == KisSmoothingOptions::STABILIZER) { | 587 | if (m_d->smoothingOptions->smoothingType() == KisSmoothingOptions::STABILIZER) { | ||
| 588 | m_d->stabilizedSampler.addEvent(info); | 588 | m_d->stabilizedSampler.addEvent(info); | ||
| 589 | if (m_d->stabilizerDelayedPaintHelper.running()) { | ||||
| 590 | // Paint here so we don't have to rely on the timer | ||||
| 591 | // This is just a tricky source for a relatively stable 7ms "timer" | ||||
| 592 | m_d->stabilizerDelayedPaintHelper.paintSome(); | ||||
| 593 | } | ||||
| 589 | } else { | 594 | } else { | ||
| 590 | m_d->previousPaintInformation = info; | 595 | m_d->previousPaintInformation = info; | ||
| 591 | } | 596 | } | ||
| 592 | 597 | | |||
| 593 | if(m_d->airbrushingTimer.isActive()) { | 598 | if(m_d->airbrushingTimer.isActive()) { | ||
| 594 | m_d->airbrushingTimer.start(); | 599 | m_d->airbrushingTimer.start(); | ||
| 595 | } | 600 | } | ||
| 596 | } | 601 | } | ||
| ▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | 672 | { | |||
| 676 | } | 681 | } | ||
| 677 | 682 | | |||
| 678 | // Poll and draw regularly | 683 | // Poll and draw regularly | ||
| 679 | KisConfig cfg; | 684 | KisConfig cfg; | ||
| 680 | int stabilizerSampleSize = cfg.stabilizerSampleSize(); | 685 | int stabilizerSampleSize = cfg.stabilizerSampleSize(); | ||
| 681 | m_d->stabilizerPollTimer.setInterval(stabilizerSampleSize); | 686 | m_d->stabilizerPollTimer.setInterval(stabilizerSampleSize); | ||
| 682 | m_d->stabilizerPollTimer.start(); | 687 | m_d->stabilizerPollTimer.start(); | ||
| 683 | 688 | | |||
| 684 | int delayedPaintInterval = cfg.stabilizerDelayedPaintInterval(); | 689 | bool delayedPaintEnabled = cfg.stabilizerDelayedPaint(); | ||
| 685 | if (delayedPaintInterval < stabilizerSampleSize) { | 690 | if (delayedPaintEnabled) { | ||
| 686 | m_d->stabilizerDelayedPaintHelper.start(delayedPaintInterval, firstPaintInfo); | 691 | m_d->stabilizerDelayedPaintHelper.start(firstPaintInfo); | ||
| 687 | } | 692 | } | ||
| 688 | 693 | | |||
| 689 | m_d->stabilizedSampler.clear(); | 694 | m_d->stabilizedSampler.clear(); | ||
| 690 | m_d->stabilizedSampler.addEvent(firstPaintInfo); | 695 | m_d->stabilizedSampler.addEvent(firstPaintInfo); | ||
| 691 | } | 696 | } | ||
| 692 | 697 | | |||
| 693 | KisPaintInformation | 698 | KisPaintInformation | ||
| 694 | KisToolFreehandHelper::getStabilizedPaintInfo(const QQueue<KisPaintInformation> &queue, | 699 | KisToolFreehandHelper::getStabilizedPaintInfo(const QQueue<KisPaintInformation> &queue, | ||
| ▲ Show 20 Lines • Show All 275 Lines • ▼ Show 20 Line(s) | |||||
| 970 | { | 975 | { | ||
| 971 | return m_d->canvasMirroredH; | 976 | return m_d->canvasMirroredH; | ||
| 972 | } | 977 | } | ||
| 973 | 978 | | |||
| 974 | void KisToolFreehandHelper::setCanvasHorizontalMirrorState(bool mirrored) | 979 | void KisToolFreehandHelper::setCanvasHorizontalMirrorState(bool mirrored) | ||
| 975 | { | 980 | { | ||
| 976 | m_d->canvasMirroredH = mirrored; | 981 | m_d->canvasMirroredH = mirrored; | ||
| 977 | } | 982 | } | ||
| 978 | | ||||