Differential D19155 Diff 52082 plugins/dockers/advancedcolorselector/kis_color_selector_component.cpp
Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/advancedcolorselector/kis_color_selector_component.cpp
Context not available. | |||||
77 | int newX=qBound(0, (x-m_x), width()); | 77 | int newX=qBound(0, (x-m_x), width()); | ||
---|---|---|---|---|---|
78 | int newY=qBound(0, (y-m_y), height()); | 78 | int newY=qBound(0, (y-m_y), height()); | ||
79 | 79 | | |||
80 | selectColor(newX, newY); | 80 | if (allowsColorSelectionAtPoint(QPoint(x, y))) { | ||
81 | m_lastX=newX; | 81 | m_lastSelectedColor = selectColor(newX, newY); | ||
82 | m_lastY=newY; | 82 | m_lastX=newX; | ||
83 | m_lastY=newY; | ||||
84 | } | ||||
83 | } | 85 | } | ||
84 | 86 | | |||
85 | const KoColorSpace* KisColorSelectorComponent::colorSpace() const | 87 | const KoColorSpace* KisColorSelectorComponent::colorSpace() const | ||
Context not available. | |||||
92 | void KisColorSelectorComponent::setDirty() | 94 | void KisColorSelectorComponent::setDirty() | ||
93 | { | 95 | { | ||
94 | m_dirty = true; | 96 | m_dirty = true; | ||
97 | setColor(m_lastSelectedColor); | ||||
95 | } | 98 | } | ||
96 | 99 | | |||
97 | void KisColorSelectorComponent::setGamutMask(KoGamutMask *gamutMask) | 100 | void KisColorSelectorComponent::setGamutMask(KoGamutMask *gamutMask) | ||
Context not available. | |||||
133 | return false; | 136 | return false; | ||
134 | } | 137 | } | ||
135 | 138 | | |||
139 | bool KisColorSelectorComponent::allowsColorSelectionAtPoint(const QPoint &pt) const | ||||
140 | { | ||||
141 | return true; | ||||
142 | } | ||||
143 | | ||||
136 | KoColor KisColorSelectorComponent::currentColor() | 144 | KoColor KisColorSelectorComponent::currentColor() | ||
137 | { | 145 | { | ||
138 | return selectColor(m_lastX, m_lastY); | 146 | return selectColor(m_lastX, m_lastY); | ||
Context not available. | |||||
230 | m_type = type; | 238 | m_type = type; | ||
231 | } | 239 | } | ||
232 | 240 | | |||
241 | void KisColorSelectorComponent::setColor(const KoColor &color) | ||||
242 | { | ||||
243 | m_lastSelectedColor = color; | ||||
244 | } | ||||
245 | | ||||
233 | void KisColorSelectorComponent::setLastMousePosition(int x, int y) | 246 | void KisColorSelectorComponent::setLastMousePosition(int x, int y) | ||
234 | { | 247 | { | ||
235 | // prevent movement due to rounding errors | 248 | // prevent movement due to rounding errors | ||
Context not available. |