#include <KisPathEnclosingProducer.h>
Definition at line 42 of file KisPathEnclosingProducer.h.
◆ KisPathEnclosingProducer()
| KisPathEnclosingProducer::KisPathEnclosingProducer |
( |
KoCanvasBase * | canvas | ) |
|
◆ ~KisPathEnclosingProducer()
| KisPathEnclosingProducer::~KisPathEnclosingProducer |
( |
| ) |
|
|
override |
◆ addPathShape()
Definition at line 158 of file KisPathEnclosingProducer.cpp.
159{
161 if (!kisCanvas) {
162 return;
163 }
164
167
170
173 painter.setAntiAliasPolygonFill(false);
176
177 QTransform matrix;
178 matrix.scale(image->
xRes(), image->
yRes());
180
181 QPainterPath path = matrix.map(pathShape->
outline());
182 painter.fillPainterPath(path);
184
185 delete pathShape;
186
188}
KisImageWSP image() const
const KoColorSpace * colorSpace() const
@ FillStyleForegroundColor
void enclosingMaskProduced(KisPixelSelectionSP enclosingMask)
virtual QPointF normalize()
Normalizes the path data.
void close()
Closes the current subpath.
QPainterPath outline() const override
reimplemented
QPointF position() const
Get the position of the shape in pt.
void setOutlineCache(const QPainterPath &cache)
References KoPathShape::close(), KisPaintDevice::colorSpace(), enclosingMaskProduced(), KisPainter::fillPainterPath(), KisPainter::FillStyleForegroundColor, KisCanvas2::image(), KoPathShape::normalize(), KoPathShape::outline(), KoShape::position(), KisPainter::setAntiAliasPolygonFill(), KisPainter::setFillStyle(), KisPixelSelection::setOutlineCache(), KisPainter::setPaintColor(), KisPainter::setStrokeStyle(), KisPainter::StrokeStyleNone, KisImage::xRes(), and KisImage::yRes().
◆ beginAlternateAction()
| void KisPathEnclosingProducer::beginAlternateAction |
( |
KoPointerEvent * | event, |
|
|
AlternateAction | action ) |
|
override |
Definition at line 124 of file KisPathEnclosingProducer.cpp.
124 {
125 KisDynamicDelegateTool::beginAlternateAction(event, action);
126 if (!nodeEditable()) return;
127
128 if (nodePaintAbility() == KisDynamicDelegateTool::MYPAINTBRUSH_UNPAINTABLE) {
130 QString message = i18n("The MyPaint Brush Engine is not available for this colorspace");
132 event->ignore();
133 return;
134 }
135}
void showFloatingMessage(const QString &message, const QIcon &icon, int timeout=4500, KisFloatingMessage::Priority priority=KisFloatingMessage::Medium, int alignment=Qt::AlignCenter|Qt::TextWordWrap)
shows a floating message in the top right corner of the canvas
#define koIcon(name)
Use these macros for icons without any issues.
References koIcon, KisViewManager::showFloatingMessage(), and KisCanvas2::viewManager().
◆ beginPrimaryAction()
Definition at line 137 of file KisPathEnclosingProducer.cpp.
138{
139 if (!nodeEditable()) return;
140 KisDynamicDelegateTool::mousePressEvent(event);
141}
◆ beginPrimaryDoubleClickAction()
◆ beginShape()
| void KisPathEnclosingProducer::beginShape |
( |
| ) |
|
|
overrideprotected |
◆ continuePrimaryAction()
◆ enclosingMaskProduced
◆ endPrimaryAction()
◆ endShape()
| void KisPathEnclosingProducer::endShape |
( |
| ) |
|
|
overrideprotected |
◆ eventFilter()
| bool KisPathEnclosingProducer::eventFilter |
( |
QObject * | obj, |
|
|
QEvent * | event ) |
|
override |
Definition at line 101 of file KisPathEnclosingProducer.cpp.
102{
103 Q_UNUSED(obj);
105 return false;
106 }
107 if (event->type() == QEvent::MouseButtonPress ||
108 event->type() == QEvent::MouseButtonDblClick) {
109 QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
110 if (mouseEvent->button() == Qt::RightButton) {
112 return true;
113 }
114 } else if (event->type() == QEvent::TabletPress) {
115 QTabletEvent *tabletEvent = static_cast<QTabletEvent*>(event);
116 if (tabletEvent->button() == Qt::RightButton) {
118 return true;
119 }
120 }
121 return false;
122}
References KisDelegatedTool< BaseClass, DelegateTool, ActivationPolicy >::localTool(), and m_hasUserInteractionRunning.
◆ hasUserInteractionRunning()
| bool KisPathEnclosingProducer::hasUserInteractionRunning |
( |
| ) |
const |
◆ mousePressEvent()
◆ popupWidget()
◆ requestStrokeCancellation()
| void KisPathEnclosingProducer::requestStrokeCancellation |
( |
| ) |
|
|
overrideprotected |
◆ requestStrokeEnd()
| void KisPathEnclosingProducer::requestStrokeEnd |
( |
| ) |
|
|
overrideprotected |
◆ resetCursorStyle
| void KisPathEnclosingProducer::resetCursorStyle |
( |
| ) |
|
|
overrideprotectedslot |
Definition at line 65 of file KisPathEnclosingProducer.cpp.
66{
67 if (isEraser()) {
68 useCursor(
KisCursor::load(
"tool_polygonal_selection_enclose_eraser_cursor.png", 6, 6));
69 } else {
70 KisDynamicDelegateTool::resetCursorStyle();
71 }
72
73 overrideCursorIfNotEditable();
74}
References KisCursor::load().
◆ KisToolPathLocalTool
◆ m_hasUserInteractionRunning
| bool KisPathEnclosingProducer::m_hasUserInteractionRunning {false} |
|
private |
The documentation for this class was generated from the following files: