20 , m_parentTool(parentTool)
50 KisCursor::load(
"tool_polygonal_selection_cursor.png", 6, 6),
53 setObjectName(
"enclosing_tool_path");
54 setSupportOutline(
true);
55 setOutlineEnabled(
false);
68 useCursor(
KisCursor::load(
"tool_polygonal_selection_enclose_eraser_cursor.png", 6, 6));
70 KisDynamicDelegateTool::resetCursorStyle();
73 overrideCursorIfNotEditable();
78 KisDynamicDelegateTool::requestStrokeEnd();
84 KisDynamicDelegateTool::requestStrokeCancellation();
107 if (event->type() == QEvent::MouseButtonPress ||
108 event->type() == QEvent::MouseButtonDblClick) {
109 QMouseEvent *mouseEvent =
static_cast<QMouseEvent*
>(event);
110 if (mouseEvent->button() == Qt::RightButton) {
114 }
else if (event->type() == QEvent::TabletPress) {
115 QTabletEvent *tabletEvent =
static_cast<QTabletEvent*
>(event);
116 if (tabletEvent->button() == Qt::RightButton) {
125 KisDynamicDelegateTool::beginAlternateAction(event, action);
126 if (!nodeEditable())
return;
128 if (nodePaintAbility() == KisDynamicDelegateTool::MYPAINTBRUSH_UNPAINTABLE) {
130 QString message = i18n(
"The MyPaint Brush Engine is not available for this colorspace");
139 if (!nodeEditable())
return;
140 KisDynamicDelegateTool::mousePressEvent(event);
155 KisDynamicDelegateTool::mouseDoubleClickEvent(event);
178 matrix.scale(image->
xRes(), image->
yRes());
181 QPainterPath path = matrix.map(pathShape->
outline());
KisDelegatedTool< KisToolShape, KisToolPathLocalTool, DeselectShapesActivationPolicy > DelegatedPathTool
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KisImageWSP image() const
KisViewManager * viewManager() const
static QCursor load(const QString &cursorName, int hotspotX=-1, int hotspotY=-1)
const KoColorSpace * colorSpace() const
@ FillStyleForegroundColor
void setStrokeStyle(StrokeStyle strokeStyle)
Set the current brush stroke style.
void setFillStyle(FillStyle fillStyle)
Set the current style with which to fill.
void fillPainterPath(const QPainterPath &path)
void setPaintColor(const KoColor &color)
void setAntiAliasPolygonFill(bool antiAliasPolygonFill)
Set whether a polygon's filled area should be anti-aliased or not. The default is true.
void beginPrimaryDoubleClickAction(KoPointerEvent *event) override
KisPathEnclosingProducer(KoCanvasBase *canvas)
void addPathShape(KoPathShape *pathShape)
bool m_hasUserInteractionRunning
void endPrimaryAction(KoPointerEvent *event) override
void resetCursorStyle() override
void mousePressEvent(KoPointerEvent *event) override
void enclosingMaskProduced(KisPixelSelectionSP enclosingMask)
void beginShape() override
void requestStrokeCancellation() override
void beginPrimaryAction(KoPointerEvent *event) override
void continuePrimaryAction(KoPointerEvent *event) override
KisPopupWidgetInterface * popupWidget() override
void beginAlternateAction(KoPointerEvent *event, AlternateAction action) override
bool eventFilter(QObject *obj, QEvent *event) override
bool hasUserInteractionRunning() const
void requestStrokeEnd() override
~KisPathEnclosingProducer() override
KisCanvasResourceProvider * canvasResourceProvider()
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
The position of a path point within a path shape.
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.
#define koIcon(name)
Use these macros for icons without any issues.
void setOutlineCache(const QPainterPath &cache)