Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/tool/strokes/kis_color_picker_stroke_strategy.cpp
Context not available. | |||||
26 | Private() : shouldSkipWork(false) {} | 26 | Private() : shouldSkipWork(false) {} | ||
---|---|---|---|---|---|
27 | 27 | | |||
28 | bool shouldSkipWork; | 28 | bool shouldSkipWork; | ||
29 | int radius = 1; | | |||
30 | int blend = 100; | | |||
31 | }; | 29 | }; | ||
32 | 30 | | |||
33 | KisColorPickerStrokeStrategy::KisColorPickerStrokeStrategy(int lod) | 31 | KisColorPickerStrokeStrategy::KisColorPickerStrokeStrategy() | ||
34 | : m_d(new Private) | 32 | : m_d(new Private) | ||
35 | { | 33 | { | ||
36 | setSupportsWrapAroundMode(true); | 34 | setSupportsWrapAroundMode(true); | ||
37 | enableJob(KisSimpleStrokeStrategy::JOB_DOSTROKE); | 35 | enableJob(KisSimpleStrokeStrategy::JOB_DOSTROKE); | ||
38 | | ||||
39 | KisToolUtils::ColorPickerConfig config; | | |||
40 | config.load(); | | |||
41 | | ||||
42 | m_d->radius = qMax(1, qRound(config.radius * KisLodTransform::lodToScale(lod))); | | |||
43 | m_d->blend = config.blend; | | |||
44 | } | 36 | } | ||
45 | 37 | | |||
46 | KisColorPickerStrokeStrategy::~KisColorPickerStrokeStrategy() | 38 | KisColorPickerStrokeStrategy::~KisColorPickerStrokeStrategy() | ||
Context not available. | |||||
56 | 48 | | |||
57 | KoColor color; | 49 | KoColor color; | ||
58 | KoColor previous = d->currentColor; | 50 | KoColor previous = d->currentColor; | ||
59 | if (KisToolUtils::pickColor(color, d->dev, d->pt, &previous, m_d->radius, m_d->blend) == true) { | 51 | if (KisPickerUtils::pickColor(color, d->dev, d->canvas, d->pt, &previous, d->radius, d->mix, d->pure) == true) { | ||
60 | emit sigColorUpdated(color); | 52 | emit sigColorUpdated(color); | ||
61 | } | 53 | } | ||
62 | } | 54 | } | ||
63 | 55 | | |||
64 | KisStrokeStrategy* KisColorPickerStrokeStrategy::createLodClone(int levelOfDetail) | 56 | KisStrokeStrategy* KisColorPickerStrokeStrategy::createLodClone(int levelOfDetail) | ||
65 | { | 57 | { | ||
58 | Q_UNUSED(levelOfDetail); | ||||
59 | | ||||
66 | m_d->shouldSkipWork = true; | 60 | m_d->shouldSkipWork = true; | ||
67 | 61 | | |||
68 | KisColorPickerStrokeStrategy *lodStrategy = new KisColorPickerStrokeStrategy(levelOfDetail); | 62 | KisColorPickerStrokeStrategy *lodStrategy = new KisColorPickerStrokeStrategy(); | ||
69 | connect(lodStrategy, &KisColorPickerStrokeStrategy::sigColorUpdated, | 63 | connect(lodStrategy, &KisColorPickerStrokeStrategy::sigColorUpdated, | ||
70 | this, &KisColorPickerStrokeStrategy::sigColorUpdated, | 64 | this, &KisColorPickerStrokeStrategy::sigColorUpdated, | ||
71 | Qt::DirectConnection); | 65 | Qt::DirectConnection); | ||
Context not available. |