Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/advancedcolorselector/kis_color_selector_wheel.cpp
Context not available. | |||||
177 | 177 | | |||
---|---|---|---|---|---|
178 | setLastMousePosition(pos.x(), pos.y()); | 178 | setLastMousePosition(pos.x(), pos.y()); | ||
179 | } | 179 | } | ||
180 | | ||||
181 | KisColorSelectorComponent::setColor(color); | ||||
180 | } | 182 | } | ||
181 | 183 | | |||
182 | void KisColorSelectorWheel::paint(QPainter* painter) | 184 | void KisColorSelectorWheel::paint(QPainter* painter) | ||
Context not available. | |||||
257 | } | 259 | } | ||
258 | } | 260 | } | ||
259 | 261 | | |||
260 | void KisColorSelectorWheel::mouseEvent(int x, int y) | | |||
261 | { | | |||
262 | int newX=qBound(0, (x-m_x), width()); | | |||
263 | int newY=qBound(0, (y-m_y), height()); | | |||
264 | | ||||
265 | if (coordIsClear(newX,newY)) { | | |||
266 | selectColor(newX, newY); | | |||
267 | m_lastX=newX; | | |||
268 | m_lastY=newY; | | |||
269 | } | | |||
270 | } | | |||
271 | | ||||
272 | KoColor KisColorSelectorWheel::colorAt(int x, int y, bool forceValid) | 262 | KoColor KisColorSelectorWheel::colorAt(int x, int y, bool forceValid) | ||
273 | { | 263 | { | ||
274 | KoColor color(Qt::transparent, m_parent->colorSpace()); | 264 | KoColor color(Qt::transparent, m_parent->colorSpace()); | ||
Context not available. | |||||
327 | return color; | 317 | return color; | ||
328 | } | 318 | } | ||
329 | 319 | | |||
330 | bool KisColorSelectorWheel::coordIsClear(int x, int y) | 320 | bool KisColorSelectorWheel::allowsColorSelectionAtPoint(const QPoint &pt) const | ||
331 | { | 321 | { | ||
332 | bool retval = false; | 322 | return !m_gamutMaskOn || !m_currentGamutMask || | ||
333 | if (m_gamutMaskOn && m_currentGamutMask) { | 323 | m_currentGamutMask->coordIsClear(m_toRenderArea.map(QPointF(pt)), | ||
334 | bool isClear = m_currentGamutMask->coordIsClear(m_toRenderArea.map(QPointF(x,y)), *m_viewConverter, m_maskPreviewActive); | 324 | *m_viewConverter, m_maskPreviewActive); | ||
335 | retval = (isClear) ? true : false; | | |||
336 | } else { | | |||
337 | retval = true; | | |||
338 | } | | |||
339 | | ||||
340 | return retval; | | |||
341 | } | 325 | } | ||
Context not available. |