QRectF KisDuplicateOpSettings::paintOutlineRect(const QPointF& pos, KisImageSP image) const { KisBrushSP brush = m_optionsWidget->m_brushOption->brush(); QPointF hotSpot = brush->hotSpot(1.0, 1.0); QRectF rect = image->pixelToDocument(QRect(0,0, brush->width(), brush->height()) ); rect.translate( pos - hotSpot + QPoint(1,1) ); rect |= duplicateOutlineRect(pos, image); return rect; }
void KisDuplicateOpSettings::paintOutline(const QPointF& pos, KisImageWSP image, QPainter &painter, OutlineMode _mode) const { painter.save(); KisBrushBasedPaintOpSettings::paintOutline(pos, image, painter, _mode); painter.restore(); QRectF rect2 = duplicateOutlineRect(pos, image); painter.drawLine(rect2.topLeft(), rect2.bottomRight()); painter.drawLine(rect2.topRight(), rect2.bottomLeft()); }
void KisDuplicateOpSettings::paintOutline(const QPointF& pos, KisImageSP image, QPainter &painter, const KoViewConverter &converter) const { KisBrushSP brush = m_optionsWidget->m_brushOption->brush(); QPointF hotSpot = brush->hotSpot(1.0, 1.0); painter.setPen(Qt::black); painter.setBackground(Qt::black); painter.drawEllipse( converter.documentToView( image->pixelToDocument(QRect(0,0, brush->width(), brush->height()) ).translated( pos - hotSpot + QPoint(1,1) ) ) ); QRectF rect2 = converter.documentToView( duplicateOutlineRect( pos, image ) ); painter.drawLine(rect2.topLeft(), rect2.bottomRight() ); painter.drawLine(rect2.topRight(), rect2.bottomLeft() ); }