22
22
#include <kis_brush_size_option.h>
24
#include <kis_airbrush_option.h>
25
#include <kis_deform_option.h>
24
27
bool KisDeformPaintOpSettings::paintIncremental()
30
QRectF KisDeformPaintOpSettings::paintOutlineRect(const QPointF& pos, KisImageWSP image, OutlineMode _mode) const
32
if (_mode != CURSOR_IS_OUTLINE) return QRectF();
33
qreal width = getDouble(BRUSH_DIAMETER) * getDouble(BRUSH_SCALE);
34
qreal height = getDouble(BRUSH_DIAMETER) * getDouble(BRUSH_ASPECT) * getDouble(BRUSH_SCALE);
35
QRectF brush(0,0,width,height);
36
brush.translate(-brush.center());
39
m.rotate(getDouble(BRUSH_ROTATION));
40
brush = m.mapRect(brush);
41
brush.adjust(-1,-1,1,1);
42
return image->pixelToDocument(brush).translated(pos);
45
void KisDeformPaintOpSettings::paintOutline(const QPointF& pos, KisImageWSP image, QPainter &painter, OutlineMode _mode) const
47
if (_mode != CURSOR_IS_OUTLINE) return;
48
qreal width = getDouble(BRUSH_DIAMETER) * getDouble(BRUSH_SCALE);
49
qreal height = getDouble(BRUSH_DIAMETER) * getDouble(BRUSH_ASPECT) * getDouble(BRUSH_SCALE);
51
QRectF brush(0,0,width,height);
52
brush.translate(-brush.center());
54
painter.translate( pos);
55
painter.rotate(getDouble(BRUSH_ROTATION));
56
painter.setPen(Qt::black);
57
painter.drawEllipse(image->pixelToDocument(brush));
32
bool KisDeformPaintOpSettings::isAirbrushing() const
35
if (hasProperty(AIRBRUSH_ENABLED)){
36
return getBool(AIRBRUSH_ENABLED);
38
return getBool(DEFORM_USE_MOVEMENT_PAINT);
42
int KisDeformPaintOpSettings::rate() const
44
if (hasProperty(AIRBRUSH_RATE)){
45
return getInt(AIRBRUSH_RATE);
47
return KisPaintOpSettings::rate();
51
QPainterPath KisDeformPaintOpSettings::brushOutline(const QPointF& pos, KisPaintOpSettings::OutlineMode mode, qreal scale, qreal rotation) const
54
if (mode == CursorIsOutline){
55
qreal width = getInt(BRUSH_DIAMETER);
56
qreal height = getInt(BRUSH_DIAMETER) * getDouble(BRUSH_ASPECT);
57
path = ellipseOutline(width, height,getDouble(BRUSH_SCALE),getDouble(BRUSH_ROTATION) );
58
QTransform m; m.reset(); m.scale(scale,scale); m.rotateRadians(rotation);