void KisExperimentPaintOpSettings::paintOutline(const QPointF& pos, KisImageWSP image, QPainter &painter, OutlineMode _mode) const { if (_mode != CursorIsOutline) return; qreal width = getInt(EXPERIMENT_START_SIZE); /* scale();*/ qreal height = getInt(EXPERIMENT_START_SIZE); /* scale();*/ painter.setPen(QColor(255,128,255)); painter.setCompositionMode(QPainter::RasterOp_SourceXorDestination); painter.drawEllipse(image->pixelToDocument(QRectF(0, 0, width, height).translated(- QPoint(width * 0.5, height * 0.5))).translated(pos)); }
QRectF KisExperimentPaintOpSettings::paintOutlineRect(const QPointF& pos, KisImageWSP image, OutlineMode _mode) const { if (_mode != CursorIsOutline) return QRectF(); qreal width = getInt(EXPERIMENT_START_SIZE); /* scale();*/ qreal height = getInt(EXPERIMENT_START_SIZE); /* scale();*/ width += 10; height += 10; QRectF rc = QRectF(0, 0, width, height); return image->pixelToDocument(rc.translated(- QPoint(width * 0.5, height * 0.5))).translated(pos); }
QRectF KisDuplicateOpSettings::duplicateOutlineRect(const QPointF& pos, KisImageWSP image) const { // Compute the rectangle for the offset QRectF rect2 = QRectF(-5, -5, 10, 10); if (m_isOffsetNotUptodate) { rect2.translate(m_position); } else { rect2.translate(- m_offset + image->documentToPixel(pos)); } return image->pixelToDocument(rect2); }
QRectF KisDuplicateOpSettings::paintOutlineRect(const QPointF& pos, KisImageWSP image, OutlineMode _mode) const { /*QRectF dubRect = duplicateOutlineRect(pos, image); if (_mode == CursorIsOutline) { dubRect |= KisBrushBasedPaintOpSettings::paintOutlineRect(pos, image, _mode); } return dubRect;*/ if (_mode != CursorIsOutline) return QRectF(); QPointF hotSpot = KisBrushBasedPaintOpSettings::brushOutline(pos,_mode).boundingRect().center(); QRectF boundRect = brushOutline(pos,_mode).boundingRect(); return image->pixelToDocument(boundRect.translated(-hotSpot)).translated(pos); }
QRectF KisPaintOpSettings::paintOutlineRect(const QPointF& pos, KisImageWSP image, OutlineMode _mode) const { Q_UNUSED(_mode); QRectF rect = QRectF(-5, -5, 10, 10); return image->pixelToDocument(rect).translated(pos); }