|
Krita Source Code Documentation
|
#include <kis_tool_paint.h>
Inheritance diagram for KisToolPaint:Classes | |
| struct | Private |
Public Slots | |
| void | activate (const QSet< KoShape * > &shapes) override |
| void | deactivate () override |
Public Slots inherited from KisTool | |
| void | activate (const QSet< KoShape * > &shapes) override |
| void | canvasResourceChanged (int key, const QVariant &res) override |
| void | deactivate () override |
| virtual void | updateSettingsViews () |
Public Slots inherited from KoToolBase | |
| virtual void | activate (const QSet< KoShape * > &shapes) |
| virtual void | deactivate () |
| virtual void | documentResourceChanged (int key, const QVariant &res) |
| virtual void | repaintDecorations () |
| virtual void | requestRedoDuringStroke () |
| virtual void | requestStrokeCancellation () |
| virtual void | requestStrokeEnd () |
| virtual void | requestUndoDuringStroke () |
| void | setStatusText (const QString &statusText) |
| void | updateOptionsWidgetIcons () |
Signals | |
| void | sigPaintingFinished () |
Signals inherited from KisTool | |
| void | isActiveChanged (bool isActivated) |
Signals inherited from KoToolBase | |
| void | activateTool (const QString &id) |
| void | cursorChanged (const QCursor &cursor) |
| void | selectionChanged (bool hasSelection) |
| void | statusTextChanged (const QString &statusText) |
| void | textModeChanged (bool inTextMode) |
Public Member Functions | |
| int | flags () const override |
| KisToolPaint (KoCanvasBase *canvas, const QCursor &cursor) | |
| void | mouseMoveEvent (KoPointerEvent *event) override |
| void | mousePressEvent (KoPointerEvent *event) override |
| void | mouseReleaseEvent (KoPointerEvent *event) override |
| KisPopupWidgetInterface * | popupWidget () override |
| ~KisToolPaint () override | |
Public Member Functions inherited from KisTool | |
| virtual bool | alternateActionSupportsHiResEvents (AlternateAction action) const |
| virtual void | beginAlternateDoubleClickAction (KoPointerEvent *event, AlternateAction action) |
| virtual void | beginPrimaryAction (KoPointerEvent *event) |
| virtual void | beginPrimaryDoubleClickAction (KoPointerEvent *event) |
| virtual void | continuePrimaryAction (KoPointerEvent *event) |
| void | deleteSelection () override |
| virtual void | endPrimaryAction (KoPointerEvent *event) |
| bool | isActive () const |
| KisTool (KoCanvasBase *canvas, const QCursor &cursor) | |
| void | mouseDoubleClickEvent (KoPointerEvent *event) override |
| void | mouseTripleClickEvent (KoPointerEvent *event) override |
| virtual void | newActivationWithExternalSource (KisPaintDeviceSP externalSource) |
| newActivationWithExternalSource Makes sure that the tool is active and starts a new stroke, which will be able to access the pixels from the specified external source. | |
| KisTool::NodePaintAbility | nodePaintAbility () |
| virtual bool | primaryActionSupportsHiResEvents () const |
| virtual bool | supportsPaintingAssistants () const |
| ~KisTool () override | |
Public Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Public Member Functions inherited from KoToolBase | |
| QAction * | action (const QString &name) const |
| KoCanvasBase * | canvas () const |
| Returns the canvas the tool is working on. | |
| virtual void | copy () const |
| QCursor | cursor () const |
| return the last emitted cursor | |
| virtual void | customMoveEvent (KoPointerEvent *event) |
| virtual void | customPressEvent (KoPointerEvent *event) |
| virtual void | customReleaseEvent (KoPointerEvent *event) |
| virtual void | cut () |
| virtual QRectF | decorationsRect () const |
| int | decorationThickness () const |
| decorationThickness The minimum thickness for tool decoration lines, this is derived from the screen magnification, thus the HiDPI settings. Note: to use this effectively, also set the pen to isCosmetic(true); | |
| virtual void | deselect () |
| deselect the tool should clear the selection if it has one. | |
| virtual void | dragLeaveEvent (QDragLeaveEvent *event) |
| virtual void | dragMoveEvent (QDragMoveEvent *event, const QPointF &point) |
| virtual void | dropEvent (QDropEvent *event, const QPointF &point) |
| virtual void | explicitUserStrokeEndRequest () |
| explicitUserStrokeEndRequest is called by the input manager when the user presses Enter key or any equivalent. This callback comes before requestStrokeEnd(), which comes from a different source. | |
| KoToolFactoryBase * | factory () const |
| virtual void | focusInEvent (QFocusEvent *event) |
| virtual void | focusOutEvent (QFocusEvent *event) |
| virtual bool | hasSelection () |
| virtual void | inputMethodEvent (QInputMethodEvent *event) |
| virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
| bool | isInTextMode () const |
| bool | isOpacityPresetMode () const |
| virtual void | keyPressEvent (QKeyEvent *event) |
| virtual void | keyReleaseEvent (QKeyEvent *event) |
| KoToolBase (KoCanvasBase *canvas) | |
| bool | maskSyntheticEvents () const |
| QList< QPointer< QWidget > > | optionWidgets () |
| virtual bool | paste () |
| virtual QMenu * | popupActionsMenu () |
| virtual bool | selectAll () |
| selectAll select all data the tool can select. | |
| virtual KoToolSelection * | selection () |
| Q_INVOKABLE QString | toolId () const |
| virtual bool | wantsAutoScroll () const |
| ~KoToolBase () override | |
Protected Member Functions | |
| void | activateAlternateAction (AlternateAction action) override |
| void | activatePrimaryAction () override |
| void | addOptionWidgetLayout (QLayout *layout) |
| Add the tool-specific layout to the default option widget layout. | |
| virtual void | addOptionWidgetOption (QWidget *control, QWidget *label=nullptr) |
| Add a widget and a label to the current option widget layout. | |
| void | beginAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| void | canvasResourceChanged (int key, const QVariant &v) override |
| void | continueAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| QWidget * | createOptionWidget () override |
| void | deactivateAlternateAction (AlternateAction action) override |
| void | deactivatePrimaryAction () override |
| void | enableControl (QWidget *control, bool value) |
| void | endAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| virtual KisOptimizedBrushOutline | getOutlinePath (const QPointF &documentPos, const KoPointerEvent *event, KisPaintOpSettings::OutlineMode outlineMode) |
| bool | isEraser () const |
| bool | isOutlineEnabled () const |
| bool | isOutlineVisible () const |
| void | paint (QPainter &gc, const KoViewConverter &converter) override |
| virtual QString | quickHelp () const |
| virtual void | requestUpdateOutline (const QPointF &outlineDocPoint, const KoPointerEvent *event) |
| void | setMode (ToolMode mode) override |
| void | setOutlineEnabled (bool enabled) |
| void | setOutlineVisible (bool visible) |
| void | setSupportOutline (bool supportOutline) |
| void | showControl (QWidget *control, bool value) |
Protected Member Functions inherited from KisTool | |
| bool | blockUntilOperationsFinished () |
| void | blockUntilOperationsFinishedForced () |
| QPointF | convertDocumentToWidget (const QPointF &pt) |
| QPoint | convertToImagePixelCoordFloored (KoPointerEvent *e) |
| QPointF | convertToPixelCoord (const QPointF &pt) |
| QPointF | convertToPixelCoord (KoPointerEvent *e) |
| QPointF | convertToPixelCoordAndAlignOnWidget (const QPointF &pt) |
| QPointF | convertToPixelCoordAndSnap (const QPointF &pt, const QPointF &offset=QPointF()) |
| QPointF | convertToPixelCoordAndSnap (KoPointerEvent *e, const QPointF &offset=QPointF(), bool useModifiers=true) |
| QRectF | convertToPt (const QRectF &rect) |
| qreal | convertToPt (qreal value) |
| KoColor | currentBgColor () |
| KoColor | currentFgColor () |
| KisFilterConfigurationSP | currentGenerator () |
| KoAbstractGradientSP | currentGradient () |
| KisImageWSP | currentImage () |
| KisNodeSP | currentNode () const |
| KisPaintOpPresetSP | currentPaintOpPreset () |
| KoPatternSP | currentPattern () |
| QCursor | cursor () const |
| KisImageWSP | image () const |
| virtual bool | listeningToModifiers () |
| virtual void | listenToModifiers (bool listen) |
| virtual ToolMode | mode () const |
| bool | nodeEditable () |
| Checks checks if the current node is editable. | |
| bool | overrideCursorIfNotEditable () |
| Override the cursor appropriately if current node is not editable. | |
| void | paintToolOutline (QPainter *painter, const KisOptimizedBrushOutline &path) |
| KisOptimizedBrushOutline | pixelToView (const KisOptimizedBrushOutline &path) const |
| QPainterPath | pixelToView (const QPainterPath &pixelPath) const |
| Convert a pixel path into a view path. | |
| QPointF | pixelToView (const QPoint &pixelCoord) const |
| QPointF | pixelToView (const QPointF &pixelCoord) const |
| Convert a floating point pixel coordinate into a view coordinate. | |
| QPolygonF | pixelToView (const QPolygonF &pixelPolygon) const |
| Convert a pixel polygon into a view path. | |
| QRectF | pixelToView (const QRectF &pixelRect) const |
| Convert a pixel rectangle into a view rectangle. | |
| KisNodeList | selectedNodes () const |
| bool | selectionEditable () |
| Checks checks if the selection is editable, only applies to local selection as global selection is always editable. | |
| void | setCursor (const QCursor &cursor) |
| void | updateCanvasPixelRect (const QRectF &pixelRect) |
| Update the canvas for the given rectangle in image pixel coordinates. | |
| void | updateCanvasViewRect (const QRectF &viewRect) |
| Update the canvas for the given rectangle in view coordinates. | |
| QPointF | viewToPixel (const QPointF &viewCoord) const |
| QPointF | widgetCenterInWidgetPixels () |
Protected Member Functions inherited from KoToolBase | |
| virtual QList< QPointer< QWidget > > | createOptionWidgets () |
| int | grabSensitivity () const |
| Convenience function to get the current grab sensitivity. | |
| qreal | handleDocRadius () const |
| QRectF | handleGrabRect (const QPointF &position) const |
| QRectF | handlePaintRect (const QPointF &position) const |
| int | handleRadius () const |
| Convenience function to get the current handle radius. | |
| bool | isActivated () const |
| KoToolBase (KoToolBasePrivate &dd) | |
| KoPointerEvent * | lastDeliveredPointerEvent () const |
| void | setAbstractResource (KoAbstractCanvasResourceInterfaceSP abstractResource) |
| void | setConverter (KoDerivedResourceConverterSP converter) |
| void | setIsOpacityPresetMode (bool value) |
| void | setMaskSyntheticEvents (bool value) |
| void | setTextMode (bool value) |
| QHash< int, KoAbstractCanvasResourceInterfaceSP > | toolAbstractResources () |
| QHash< int, KoDerivedResourceConverterSP > | toolConverters () |
| void | useCursor (const QCursor &cursor) |
Protected Attributes | |
| KisOptimizedBrushOutline | m_currentOutline |
| QRectF | m_oldColorPreviewUpdateRect |
| QRectF | m_oldOutlineRect |
| QPointF | m_outlineDocPoint |
| bool | m_paintOutline {false} |
Protected Attributes inherited from KoToolBase | |
| KoToolBasePrivate * | d_ptr |
Private Member Functions | |
| bool | isSamplingAction (AlternateAction action) |
| KisOptimizedBrushOutline | tryFixBrushOutline (const KisOptimizedBrushOutline &originalOutline) |
| void | tryRestoreOpacitySnapshot () |
Private Attributes | |
| KisAsyncColorSamplerHelper | m_colorSamplerHelper |
| QScopedPointer< Private > | m_d |
| bool | m_isOutlineEnabled |
| bool | m_isOutlineVisible |
| qreal | m_oldOpacity {1.0} |
| KisPaintOpPresetSP | m_oldPreset |
| bool | m_oldPresetIsDirty {false} |
| int | m_oldPresetVersion {-1} |
| QGridLayout * | m_optionsWidgetLayout {nullptr} |
| bool | m_specialHoverModifier {false} |
| KisToolUtils::StandardBrushSizes | m_standardBrushSizes |
| bool | m_supportOutline {false} |
Definition at line 34 of file kis_tool_paint.h.
| KisToolPaint::KisToolPaint | ( | KoCanvasBase * | canvas, |
| const QCursor & | cursor ) |
Definition at line 78 of file kis_tool_paint.cc.
References Private::canvas, KisViewManager::canvasResourceProvider(), KIS_ASSERT, m_colorSamplerHelper, sigPaintingFinished(), slotColorPickerRequestedCursor(), slotColorPickerRequestedCursorReset(), slotColorPickerRequestedOutlineUpdate(), and KisCanvas2::viewManager().
|
override |
Definition at line 96 of file kis_tool_paint.cc.
Definition at line 158 of file kis_tool_paint.cc.
References KoToolBase::action(), KisTool::activate(), KisTool::currentPaintOpPreset(), decreaseBrushSize(), KisTool::FLAG_USES_CUSTOM_SIZE, flags(), increaseBrushSize(), rotateBrushTipClockwise(), rotateBrushTipClockwisePrecise(), rotateBrushTipCounterClockwise(), rotateBrushTipCounterClockwisePrecise(), showBrushSize(), KoToolBase::statusTextChanged(), and tryRestoreOpacitySnapshot().
|
overrideprotectedvirtual |
Reimplemented from KisTool.
Reimplemented in KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 284 of file kis_tool_paint.cc.
References KoToolBase::action(), KisAsyncColorSamplerHelper::activate(), KisTool::activateAlternateAction(), isSamplingAction(), m_colorSamplerHelper, KisTool::SampleBgNode, KisTool::SampleFgImage, and KisTool::SampleFgNode.
|
overrideprotectedvirtual |
Called by KisToolProxy when the primary action of the tool is going to be started now, that is when all the modifiers are pressed and the only thing left is just to press the mouse button. On coming of this callback the tool is supposed to prepare the cursor and/or the outline to show the user shat is going to happen next
Reimplemented from KisTool.
Reimplemented in KisToolSmartPatch.
Definition at line 489 of file kis_tool_paint.cc.
References KisTool::activatePrimaryAction(), and setOutlineVisible().
|
protected |
Add the tool-specific layout to the default option widget layout.
Definition at line 463 of file kis_tool_paint.cc.
References m_optionsWidgetLayout.
|
protectedvirtual |
Add a widget and a label to the current option widget layout.
Definition at line 471 of file kis_tool_paint.cc.
References m_optionsWidgetLayout.
|
overrideprotectedvirtual |
Reimplemented from KisTool.
Reimplemented in KisToolPolylineBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 313 of file kis_tool_paint.cc.
References KoToolBase::action(), KisTool::beginAlternateAction(), KisToolUtils::ColorSamplerConfig::blend, isSamplingAction(), KisToolUtils::ColorSamplerConfig::load(), m_colorSamplerHelper, KoPointerEvent::point, KisToolUtils::ColorSamplerConfig::radius, requestUpdateOutline(), KisTool::SECONDARY_PAINT_MODE, setMode(), and KisAsyncColorSamplerHelper::startAction().
|
overrideprotectedvirtual |
This method is called whenever a property in the resource provider associated with the canvas this tool belongs to changes. An example is currently selected foreground color.
Reimplemented from KoToolBase.
Definition at line 105 of file kis_tool_paint.cc.
References KisTool::canvasResourceChanged(), KoCanvasResource::CurrentPaintOpPreset, KoCanvasResource::CurrentPaintOpPresetName, KisConfigNotifier::instance(), KisTool::isActive, m_outlineDocPoint, KoCanvasResource::Opacity, requestUpdateOutline(), KisTool::resetCursorStyle(), KoToolBase::statusTextChanged(), and v.
|
overrideprotectedvirtual |
Reimplemented from KisTool.
Reimplemented in KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 328 of file kis_tool_paint.cc.
References KoToolBase::action(), KisAsyncColorSamplerHelper::continueAction(), KisTool::continueAlternateAction(), isSamplingAction(), m_colorSamplerHelper, KoPointerEvent::point, and requestUpdateOutline().
|
overrideprotectedvirtual |
Reimplement this if your tool actually has an option widget. Sets the option widget to 0 by default.
Reimplemented from KisTool.
Reimplemented in KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolShape, KisToolPolyline, and KisToolSmartPatch.
Definition at line 385 of file kis_tool_paint.cc.
References KisIconUtils::loadIcon(), m_optionsWidgetLayout, KisTool::optionWidget, quickHelp(), slotPopupQuickHelp(), and KoToolBase::toolId().
|
overrideslot |
Definition at line 182 of file kis_tool_paint.cc.
References KoToolBase::action(), KisTool::deactivate(), KisTool::FLAG_USES_CUSTOM_SIZE, flags(), KoToolBase::statusTextChanged(), and tryRestoreOpacitySnapshot().
|
overrideprotectedvirtual |
Reimplemented from KisTool.
Reimplemented in KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 296 of file kis_tool_paint.cc.
References KoToolBase::action(), KisAsyncColorSamplerHelper::deactivate(), KisTool::deactivateAlternateAction(), isSamplingAction(), and m_colorSamplerHelper.
|
overrideprotectedvirtual |
Called by KisToolProxy when the primary is no longer possible to be started now, e.g. when its modifiers and released. The tool is supposed to revert all the preparations it has done in activatePrimaryAction().
Reimplemented from KisTool.
Reimplemented in KisToolSmartPatch.
Definition at line 495 of file kis_tool_paint.cc.
References KisTool::deactivatePrimaryAction(), and setOutlineVisible().
|
privateslot |
Definition at line 531 of file kis_tool_paint.cc.
References KisTool::currentPaintOpPreset(), KisToolUtils::StandardBrushSizes::decreaseBrushSize(), m_outlineDocPoint, m_standardBrushSizes, and requestUpdateOutline().
|
protected |
Definition at line 454 of file kis_tool_paint.cc.
References findLabelWidget(), m_optionsWidgetLayout, and value().
|
overrideprotectedvirtual |
Reimplemented from KisTool.
Reimplemented in KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 338 of file kis_tool_paint.cc.
References KoToolBase::action(), KisAsyncColorSamplerHelper::endAction(), KisTool::endAlternateAction(), KisTool::HOVER_MODE, isSamplingAction(), m_colorSamplerHelper, KoPointerEvent::point, requestUpdateOutline(), and setMode().
|
overridevirtual |
Reimplemented from KisTool.
Reimplemented in KisToolShape, and KisToolSmartPatch.
Definition at line 100 of file kis_tool_paint.cc.
References KisTool::FLAG_USES_CUSTOM_COMPOSITEOP.
|
protectedvirtual |
Reimplemented in KisToolFreehand, and KisToolBasicBrushBase.
Definition at line 719 of file kis_tool_paint.cc.
References Private::canvas, KisTool::convertToPixelCoord(), KisCanvas2::coordinatesConverter, KisTool::currentPaintOpPreset(), KisAlgebra2D::directionBetweenPoints(), KisCoordinatesConverter::effectivePhysicalZoom(), KoCanvasResource::EffectiveZoom, KisTool::HOVER_MODE, KoPointerEvent::isTouchEvent(), KIS_ASSERT, m_d, KisTool::mode(), KisPaintInformation::registerDistanceInformation(), KoCanvasBase::resourceManager, KisCoordinatesConverter::rotationAngle(), KisPaintInformation::setCanvasMirroredH(), KisPaintInformation::setCanvasMirroredV(), KisPaintInformation::setCanvasRotation(), KisPaintInformation::setPerStrokeRandomSource(), KisPaintInformation::setRandomSource(), KisCoordinatesConverter::xAxisMirrored(), and KisCoordinatesConverter::yAxisMirrored().
|
privateslot |
Definition at line 523 of file kis_tool_paint.cc.
References KisTool::currentPaintOpPreset(), KisToolUtils::StandardBrushSizes::increaseBrushSize(), m_outlineDocPoint, m_standardBrushSizes, and requestUpdateOutline().
|
protected |
Definition at line 715 of file kis_tool_paint.cc.
References Private::canvas, COMPOSITE_ERASE, KoCanvasResource::CurrentEffectiveCompositeOp, and KoCanvasBase::resourceManager.
|
protected |
Definition at line 501 of file kis_tool_paint.cc.
References m_isOutlineEnabled.
|
protected |
Definition at line 512 of file kis_tool_paint.cc.
References m_isOutlineVisible.
|
private |
Definition at line 306 of file kis_tool_paint.cc.
References KoToolBase::action(), KisTool::SampleBgImage, KisTool::SampleBgNode, KisTool::SampleFgImage, and KisTool::SampleFgNode.
|
overridevirtual |
Called when the mouse or stylus moved over the canvas. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus move |
Reimplemented from KisTool.
Reimplemented in KisToolPolylineBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 357 of file kis_tool_paint.cc.
References KisTool::HOVER_MODE, KisTool::mode(), KisTool::mouseMoveEvent(), KoPointerEvent::point, and requestUpdateOutline().
|
overridevirtual |
Called when (one of) the mouse or stylus buttons is pressed. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus press |
Reimplemented from KisTool.
Definition at line 349 of file kis_tool_paint.cc.
References KisTool::HOVER_MODE, KisTool::mode(), KisTool::mousePressEvent(), KoPointerEvent::point, and requestUpdateOutline().
|
overridevirtual |
Called when (one of) the mouse or stylus buttons is released. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus release |
Reimplemented from KisTool.
Definition at line 377 of file kis_tool_paint.cc.
References KisTool::HOVER_MODE, KisTool::mode(), KisTool::mouseReleaseEvent(), KoPointerEvent::point, and requestUpdateOutline().
|
overrideprotectedvirtual |
Called by the canvas to paint any decorations that the tool deems needed. The painter has the top left of the canvas as its origin.
| painter | used for painting the shape |
| converter | to convert between internal and view coordinates. |
Implements KoToolBase.
Reimplemented in KisToolPolylineBase, KisToolRectangleBase, and KisToolSmartPatch.
Definition at line 262 of file kis_tool_paint.cc.
References m_colorSamplerHelper, m_currentOutline, KisAsyncColorSamplerHelper::paint(), KisTool::paintToolOutline(), KisTool::pixelToView(), and tryFixBrushOutline().
|
overridevirtual |
popupActionsMenu() does not return null. Reimplemented from KoToolBase.
Reimplemented in KisToolPolylineBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 365 of file kis_tool_paint.cc.
References Private::canvas, KisCanvas2::popupPalette, and popupWidget().
|
inlineprotectedvirtual |
Quick help is a short help text about the way the tool functions.
Reimplemented in KisToolLine.
Definition at line 103 of file kis_tool_paint.h.
|
protectedvirtual |
A simple "update-ahead" implementation that issues an update a little bigger to accommodate the possible following outline.
The point is that canvas rendering comes through two stages of compression and the canvas may request outline update when the outline itself has already been changed. It causes visual tearing on the screen (see https://bugs.kde.org/show_bug.cgi?id=476300).
We can solve that in two ways:
1) Pass the actual outline with the update rect itself, which is a bit complicated and may result in the outline being a bit delayed visually. We don't implement this method (yet).
2) Just pass the update rect a bit bigger than the actual outline to accommodate a possible change in the outline. We calculate this bigger rect by offsetting the rect by the previous cursor offset.
Don't try to update-ahead if the offset is bigger than 50% of the brush outline
10% of extra move is added to offset
Reimplemented in KisDynamicDelegatedTool< KisToolShape >, and KisToolSmartPatch.
Definition at line 572 of file kis_tool_paint.cc.
References KisOptimizedBrushOutline::boundingRect(), Private::canvas, KisAsyncColorSamplerHelper::colorPreviewDocRect(), KisTool::currentImage(), KisConfig::eraserOutlineStyle(), KisConfig::forceAlwaysFullSizedEraserOutline(), KisConfig::forceAlwaysFullSizedOutline(), KisPaintOpSettings::OutlineMode::forceCircle, KisPaintOpSettings::OutlineMode::forceFullSize, KisTool::GESTURE_MODE, getOutlinePath(), KisPaintingAssistantsDecoration::hasPaintableAssistants(), KisTool::HOVER_MODE, isEraser(), isOutlineEnabled(), isOutlineVisible(), KisPaintOpSettings::OutlineMode::isVisible, m_colorSamplerHelper, m_currentOutline, m_oldColorPreviewUpdateRect, m_oldOutlineRect, m_outlineDocPoint, m_supportOutline, KisAlgebra2D::maxDimension(), KisTool::mode(), KisConfig::newOutlineStyle(), KisAlgebra2D::norm(), OUTLINE_CIRCLE, OUTLINE_FULL, OUTLINE_TILT, KisTool::PAINT_MODE, KisCanvas2::paintingAssistantsDecoration(), KisImage::pixelToDocument(), KisConfig::separateEraserCursor(), KisConfig::showEraserOutlineWhilePainting(), KisConfig::showOutlineWhilePainting(), KisPaintOpSettings::OutlineMode::showTiltDecoration, tryFixBrushOutline(), KisCanvas2::updateCanvasDecorations(), KisCanvas2::updateCanvasToolOutlineDoc(), KisCanvas2::viewConverter(), KisCanvasDecoration::visible(), and KoViewConverter::zoom().
|
privateslot |
Definition at line 544 of file kis_tool_paint.cc.
References KisTool::currentPaintOpPreset(), m_outlineDocPoint, and requestUpdateOutline().
|
privateslot |
Definition at line 551 of file kis_tool_paint.cc.
References KisTool::currentPaintOpPreset(), m_outlineDocPoint, and requestUpdateOutline().
|
privateslot |
Definition at line 558 of file kis_tool_paint.cc.
References KisTool::currentPaintOpPreset(), m_outlineDocPoint, and requestUpdateOutline().
|
privateslot |
Definition at line 565 of file kis_tool_paint.cc.
References KisTool::currentPaintOpPreset(), m_outlineDocPoint, and requestUpdateOutline().
Reimplemented from KisTool.
Definition at line 272 of file kis_tool_paint.cc.
References KisTool::mode(), KisTool::PAINT_MODE, KisTool::setMode(), and sigPaintingFinished().
|
protected |
Definition at line 506 of file kis_tool_paint.cc.
References KoToolBase::lastDeliveredPointerEvent(), m_isOutlineEnabled, m_outlineDocPoint, and requestUpdateOutline().
|
protected |
Definition at line 517 of file kis_tool_paint.cc.
References KoToolBase::lastDeliveredPointerEvent(), m_isOutlineVisible, m_outlineDocPoint, and requestUpdateOutline().
|
inlineprotected |
If the paint tool support outline like brushes, set to true. If not (e.g. gradient tool), set to false. Default is false.
Definition at line 73 of file kis_tool_paint.h.
|
privateslot |
Definition at line 539 of file kis_tool_paint.cc.
References Private::canvas, KisTool::currentPaintOpPreset(), and KisToolUtils::showBrushSizeFloatingMessage().
|
protected |
Definition at line 445 of file kis_tool_paint.cc.
References findLabelWidget(), m_optionsWidgetLayout, and value().
|
signal |
|
privateslot |
Definition at line 200 of file kis_tool_paint.cc.
References KisTool::cursor, and KoToolBase::useCursor().
|
privateslot |
Definition at line 205 of file kis_tool_paint.cc.
References KisTool::resetCursorStyle().
|
privateslot |
Definition at line 210 of file kis_tool_paint.cc.
References m_outlineDocPoint, and requestUpdateOutline().
|
privateslot |
Definition at line 484 of file kis_tool_paint.cc.
References quickHelp().
|
private |
If the brush outline is bigger than the canvas itself (which would make it invisible for a user in most of the cases) just add a cross in the center of it
Definition at line 215 of file kis_tool_paint.cc.
References KisOptimizedBrushOutline::addEllipse(), KisOptimizedBrushOutline::addPath(), KisOptimizedBrushOutline::boundingRect(), Private::canvas, KisCanvas2::canvasWidget, KisConfig::eraserOutlineStyle(), KisOptimizedBrushOutline::isEmpty(), isEraser(), KisConfig::newOutlineStyle(), OUTLINE_NONE, KisConfig::outlineSizeMinimum(), and KisConfig::separateEraserCursor().
|
private |
Here is a weird heuristics on when to restore brush opacity and when not. Basically, we should restore opacity to its saved if the brush preset hasn't changed too much, that is, its version is the same and it hasn't been reset into a clean state since then. The latter condition is checked in a fuzzy manner by just mangling the isDirty state before and after.
Definition at line 133 of file kis_tool_paint.cc.
References Private::canvas, KisCanvasResourceProvider::currentPreset(), m_oldPreset, m_oldPresetIsDirty, and m_oldPresetVersion.
|
private |
Definition at line 157 of file kis_tool_paint.h.
|
protected |
Definition at line 131 of file kis_tool_paint.h.
|
private |
Definition at line 162 of file kis_tool_paint.h.
|
private |
Used as a switch for sampleColor
Definition at line 149 of file kis_tool_paint.h.
|
private |
Definition at line 150 of file kis_tool_paint.h.
|
protected |
Definition at line 133 of file kis_tool_paint.h.
|
private |
Definition at line 154 of file kis_tool_paint.h.
|
protected |
Definition at line 132 of file kis_tool_paint.h.
|
private |
Definition at line 153 of file kis_tool_paint.h.
|
private |
Definition at line 155 of file kis_tool_paint.h.
|
private |
Definition at line 156 of file kis_tool_paint.h.
|
private |
Definition at line 141 of file kis_tool_paint.h.
|
protected |
Definition at line 130 of file kis_tool_paint.h.
|
protected |
Definition at line 129 of file kis_tool_paint.h.
|
private |
Definition at line 140 of file kis_tool_paint.h.
|
private |
Definition at line 151 of file kis_tool_paint.h.
|
private |
Definition at line 143 of file kis_tool_paint.h.