コード例 #1
0
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));
}
コード例 #2
0
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);
}
コード例 #3
0
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);
}
コード例 #4
0
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);
    
}
コード例 #5
0
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);
}