|
Krita Source Code Documentation
|
#include <kis_tool_crop.h>
Inheritance diagram for KisToolCrop:Public Types | |
| enum | CropToolType { ImageCropType , CanvasCropType , LayerCropType , FrameCropType } |
Public Types inherited from KisTool | |
| enum | { FLAG_USES_CUSTOM_PRESET =0x01 , FLAG_USES_CUSTOM_COMPOSITEOP =0x02 , FLAG_USES_CUSTOM_SIZE =0x04 } |
| enum | AlternateAction { ChangeSize = AlternateChangeSize , ChangeSizeSnap = AlternateChangeSizeSnap , SampleFgNode = AlternateSampleFgNode , SampleBgNode = AlternateSampleBgNode , SampleFgImage = AlternateSampleFgImage , SampleBgImage = AlternateSampleBgImage , Secondary = AlternateSecondary , Third = AlternateThird , Fourth = AlternateFourth , Fifth = AlternateFifth , NONE = 10000 } |
| enum | NodePaintAbility { VECTOR , CLONE , PAINT , UNPAINTABLE , MYPAINTBRUSH_UNPAINTABLE } |
| enum | ToolAction { Primary , AlternateChangeSize , AlternateChangeSizeSnap , AlternateSampleFgNode , AlternateSampleBgNode , AlternateSampleFgImage , AlternateSampleBgImage , AlternateSecondary , AlternateThird , AlternateFourth , AlternateFifth , Alternate_NONE = 10000 } |
Signals | |
| void | canGrowChanged (bool value) |
| void | cropHeightChanged (int value) |
| void | cropTypeChanged (int value) |
| void | cropTypeSelectableChanged () |
| void | cropWidthChanged (int value) |
| void | cropXChanged (int value) |
| void | cropYChanged (int value) |
| void | decorationChanged (int value) |
| void | isCenteredChanged (bool value) |
| void | lockHeightChanged (bool value) |
| void | lockRatioChanged (bool value) |
| void | lockWidthChanged (bool value) |
| void | ratioChanged (double value) |
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 | |
| bool | allowGrow () const |
| void | beginPrimaryAction (KoPointerEvent *event) override |
| void | beginPrimaryDoubleClickAction (KoPointerEvent *event) override |
| void | canvasResourceChanged (int key, const QVariant &res) override |
| void | continuePrimaryAction (KoPointerEvent *event) override |
| QWidget * | createOptionWidget () override |
| int | cropHeight () const |
| CropToolType | cropType () const |
| bool | cropTypeSelectable () const |
| int | cropWidth () const |
| int | cropX () const |
| int | cropY () const |
| int | decoration () const |
| void | endPrimaryAction (KoPointerEvent *event) override |
| bool | growCenter () const |
| KisToolCrop (KoCanvasBase *canvas) | |
| bool | lockHeight () const |
| bool | lockRatio () const |
| bool | lockWidth () const |
| void | mouseMoveEvent (KoPointerEvent *e) override |
| void | paint (QPainter &painter, const KoViewConverter &converter) override |
| QMenu * | popupActionsMenu () override |
| double | ratio () const |
| ~KisToolCrop () override | |
Public Member Functions inherited from KisTool | |
| virtual void | activateAlternateAction (AlternateAction action) |
| virtual void | activatePrimaryAction () |
| virtual bool | alternateActionSupportsHiResEvents (AlternateAction action) const |
| virtual void | beginAlternateAction (KoPointerEvent *event, AlternateAction action) |
| virtual void | beginAlternateDoubleClickAction (KoPointerEvent *event, AlternateAction action) |
| virtual void | continueAlternateAction (KoPointerEvent *event, AlternateAction action) |
| virtual void | deactivateAlternateAction (AlternateAction action) |
| virtual void | deactivatePrimaryAction () |
| void | deleteSelection () override |
| virtual void | endAlternateAction (KoPointerEvent *event, AlternateAction action) |
| virtual int | flags () const |
| bool | isActive () const |
| KisTool (KoCanvasBase *canvas, const QCursor &cursor) | |
| void | mouseDoubleClickEvent (KoPointerEvent *event) override |
| void | mousePressEvent (KoPointerEvent *event) override |
| void | mouseReleaseEvent (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 KisPopupWidgetInterface * | popupWidget () |
| 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 | |
Properties | |
| int | cropHeight |
| CropToolType | cropType |
| bool | cropTypeSelectable |
| int | cropWidth |
| int | cropX |
| int | cropY |
| int | decoration |
| bool | lockHeight |
| bool | lockRatio |
| bool | lockWidth |
| double | ratio |
Properties inherited from KisTool | |
| bool | isActive |
Private Types | |
| enum | handleType { None = 0 , UpperLeft = 1 , UpperRight = 2 , LowerLeft = 3 , LowerRight = 4 , Upper = 5 , Lower = 6 , Left = 7 , Right = 8 , Inside = 9 } |
Private Member Functions | |
| QRectF | borderLineRect () |
| QRectF | boundingRect () |
| void | cancelStroke () |
| void | doCanvasUpdate (const QRect &updateRect) |
| void | drawDecorationLine (QPainter *p, DecorationLine *decorLine, QRectF rect) |
| QPainterPath | handlesPath () |
| QRectF | leftHandleRect (QRectF cropBorderRect) |
| QRectF | lowerHandleRect (QRectF cropBorderRect) |
| QRectF | lowerLeftHandleRect (QRectF cropBorderRect) |
| QRectF | lowerRightHandleRect (QRectF cropBorderRect) |
| qint32 | mouseOnHandle (const QPointF currentViewPoint) |
| void | paintOutlineWithHandles (QPainter &gc) |
| Q_ENUMS (CropToolType) | |
| QRectF | rightHandleRect (QRectF cropBorderRect) |
| void | setMoveResizeCursor (qint32 handle) |
| bool | tryContinueLastCropAction () |
| QRectF | upperHandleRect (QRectF cropBorderRect) |
| QRectF | upperLeftHandleRect (QRectF cropBorderRect) |
| QRectF | upperRightHandleRect (QRectF cropBorderRect) |
Private Attributes | |
| KisAction * | applyCrop {nullptr} |
| KisAction * | centerToggleOption {nullptr} |
| KConfigGroup | configGroup |
| KisAction * | growToggleOption {nullptr} |
| KisAction * | lockHeightToggleOption {nullptr} |
| KisAction * | lockRatioToggleOption {nullptr} |
| KisAction * | lockWidthToggleOption {nullptr} |
| QScopedPointer< QMenu > | m_contextMenu |
| CropToolType | m_cropType {ImageCropType} |
| bool | m_cropTypeSelectable {false} |
| int | m_decoration {1} |
| QList< DecorationLine * > | m_decorations |
| QPointF | m_dragOffsetDoc |
| QPoint | m_dragStart |
| KisConstrainedRect | m_finalRect |
| qint32 | m_handleSize {13} |
| bool | m_haveCropSelection {false} |
| QRect | m_initialDragRect |
| QRect | m_lastCanvasUpdateRect |
| qint32 | m_mouseOnHandleType {0} |
| bool | m_resettingStroke {false} |
| KisToolCropConfigWidget * | optionsWidget {nullptr} |
Additional Inherited Members | |
Static Public Member Functions inherited from KisTool | |
| static AlternateAction | actionToAlternateAction (ToolAction action) |
Public Attributes inherited from KisTool | |
| KoColor | currentBgColor |
| float | currentExposure {1.0} |
| KoColor | currentFgColor |
| KisFilterConfigurationSP | currentGenerator |
| KoAbstractGradientSP | currentGradient |
| KoPatternSP | currentPattern |
| QCursor | cursor |
| bool | m_isActive {false} |
| ToolMode | m_mode {HOVER_MODE} |
| QWidget * | optionWidget {0} |
Public Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Protected Types inherited from KisTool | |
| enum | ToolMode : int { HOVER_MODE , PAINT_MODE , SECONDARY_PAINT_MODE , MIRROR_AXIS_SETUP_MODE , GESTURE_MODE , PAN_MODE , OTHER , OTHER_1 } |
Protected Slots inherited from KisTool | |
| virtual void | resetCursorStyle () |
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) |
| virtual void | setMode (ToolMode mode) |
| 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 inherited from KoToolBase | |
| KoToolBasePrivate * | d_ptr |
Crop tool
Definition at line 36 of file kis_tool_crop.h.
| Enumerator | |
|---|---|
| ImageCropType | |
| CanvasCropType | |
| LayerCropType | |
| FrameCropType | |
Definition at line 54 of file kis_tool_crop.h.
|
private |
| Enumerator | |
|---|---|
| None | |
| UpperLeft | |
| UpperRight | |
| LowerLeft | |
| LowerRight | |
| Upper | |
| Lower | |
| Left | |
| Right | |
| Inside | |
Definition at line 190 of file kis_tool_crop.h.
| KisToolCrop::KisToolCrop | ( | KoCanvasBase * | canvas | ) |
Definition at line 96 of file kis_tool_crop.cc.
References applyCrop, centerToggleOption, connect(), growToggleOption, ImageCropType, lockHeightToggleOption, lockRatioToggleOption, lockWidthToggleOption, m_contextMenu, m_cropType, m_cropTypeSelectable, m_decoration, m_finalRect, m_handleSize, m_haveCropSelection, and slotRectChanged().
|
override |
Definition at line 129 of file kis_tool_crop.cc.
References applyCrop, centerToggleOption, growToggleOption, lockHeightToggleOption, lockRatioToggleOption, and lockWidthToggleOption.
Definition at line 139 of file kis_tool_crop.cc.
References KisTool::activate(), KisResourcesSnapshot::activeSelection(), bounds, Private::canvas, CanvasCropType, configGroup, connect(), KisResourcesSnapshot::currentNode(), KisTool::currentNode(), KisTool::cursor, KisTool::image(), ImageCropType, m_cropType, m_finalRect, m_haveCropSelection, KisBaseNode::paintDevice(), KisSelection::selectedExactRect(), setAllowGrow(), KisConstrainedRect::setCropRect(), setCropType(), setCropTypeSelectable(), setDecoration(), setGrowCenter(), KisConstrainedRect::setRectInitial(), showSizeOnCanvas(), KoToolBase::toolId(), and KoToolBase::useCursor().
| bool KisToolCrop::allowGrow | ( | ) | const |
Definition at line 668 of file kis_tool_crop.cc.
References KisConstrainedRect::canGrow(), and m_finalRect.
|
overridevirtual |
Called by KisToolProxy when a primary action for the tool is started. The event stores the original event that started the stroke. The event is accepted by default. If the tool decides to ignore this particular action (e.g. when the node is not editable), it should call event->ignore(). Then no further continuePrimaryAction() or endPrimaryAction() will be called until the next user action.
Reimplemented from KisTool.
Definition at line 271 of file kis_tool_crop.cc.
References KisImage::bounds(), bounds, KisTool::convertToPixelCoord(), KisTool::convertToPixelCoordAndSnap(), KisConstrainedRect::Creation, KisConstrainedRect::handleSnapPoint(), KisConstrainedRect::heightLocked(), KisTool::image(), m_dragOffsetDoc, m_dragStart, m_finalRect, m_haveCropSelection, m_initialDragRect, m_lastCanvasUpdateRect, m_mouseOnHandleType, m_resettingStroke, mouseOnHandle(), KisConstrainedRect::None, None, KisTool::PAINT_MODE, KisImage::pixelToDocument(), KisTool::pixelToView(), KisConstrainedRect::rect(), KisConstrainedRect::setCropRect(), KisTool::setMode(), KisConstrainedRect::setRectInitial(), and KisConstrainedRect::widthLocked().
|
overridevirtual |
The same as beginPrimaryAction(), but called when the stroke is started by a double-click
Reimplemented from KisTool.
Definition at line 397 of file kis_tool_crop.cc.
References crop(), and m_haveCropSelection.
|
private |
Definition at line 410 of file kis_tool_crop.cc.
References HALF_BORDER_LINE_WIDTH, m_finalRect, KisTool::pixelToView(), and KisConstrainedRect::rect().
|
private |
Definition at line 895 of file kis_tool_crop.cc.
References HANDLE_BORDER_LINE_WIDTH, and handlesPath().
|
private |
Definition at line 182 of file kis_tool_crop.cc.
References bounds, KisTool::cursor, doCanvasUpdate(), KisTool::image(), m_haveCropSelection, and KoToolBase::useCursor().
|
signal |
|
overridevirtual |
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 215 of file kis_tool_crop.cc.
References CanvasCropType, KisTool::canvasResourceChanged(), KisTool::currentNode(), ImageCropType, m_cropType, setCropType(), and setCropTypeSelectable().
|
overridevirtual |
Called by KisToolProxy when the primary action is in progress of pointer movement. If the tool has ignored the event in beginPrimaryAction(), this method will not be called.
Reimplemented from KisTool.
Definition at line 306 of file kis_tool_crop.cc.
References CHECK_MODE_SANITY_OR_RETURN, KisTool::convertToPixelCoordAndSnap(), m_dragOffsetDoc, m_dragStart, m_finalRect, m_initialDragRect, m_mouseOnHandleType, KisConstrainedRect::moveHandle(), and KisTool::PAINT_MODE.
|
overridevirtual |
Reimplement this if your tool actually has an option widget. Sets the option widget to 0 by default.
Reimplemented from KisTool.
Definition at line 732 of file kis_tool_crop.cc.
References applyCrop, centerToggleOption, connect(), crop(), cropHeightChanged(), cropTypeChanged(), cropWidthChanged(), cropXChanged(), cropYChanged(), decorationChanged(), growToggleOption, lockHeightChanged(), lockHeightToggleOption, lockRatioChanged(), lockRatioToggleOption, lockWidthChanged(), lockWidthToggleOption, optionsWidget, ratioChanged(), setAllowGrow(), setCropHeight(), setCropTypeLegacy(), setCropWidth(), setCropX(), setCropY(), setDecoration(), setGrowCenter(), setLockHeight(), setLockRatio(), setLockWidth(), setRatio(), and KoToolBase::toolId().
|
slot |
Definition at line 458 of file kis_tool_crop.cc.
References CanvasCropType, KisImage::cropImage(), KisImage::cropNode(), KisTool::currentImage(), KisTool::currentNode(), KisTool::cursor, FrameCropType, ImageCropType, KIS_ASSERT_RECOVER_RETURN, m_cropType, m_finalRect, m_haveCropSelection, KisTool::nodeEditable(), KisConstrainedRect::rect(), KisImage::resizeImage(), and KoToolBase::useCursor().
| int KisToolCrop::cropHeight | ( | ) | const |
Definition at line 644 of file kis_tool_crop.cc.
References m_finalRect, and KisConstrainedRect::rect().
|
signal |
| KisToolCrop::CropToolType KisToolCrop::cropType | ( | ) | const |
Definition at line 505 of file kis_tool_crop.cc.
References m_cropType.
|
signal |
| bool KisToolCrop::cropTypeSelectable | ( | ) | const |
Definition at line 518 of file kis_tool_crop.cc.
References m_cropTypeSelectable.
|
signal |
| int KisToolCrop::cropWidth | ( | ) | const |
Definition at line 616 of file kis_tool_crop.cc.
References m_finalRect, and KisConstrainedRect::rect().
|
signal |
| int KisToolCrop::cropX | ( | ) | const |
Definition at line 578 of file kis_tool_crop.cc.
References m_finalRect, and KisConstrainedRect::rect().
|
signal |
| int KisToolCrop::cropY | ( | ) | const |
Definition at line 598 of file kis_tool_crop.cc.
References m_finalRect, and KisConstrainedRect::rect().
|
signal |
|
overrideslot |
Definition at line 189 of file kis_tool_crop.cc.
References cancelStroke(), and KisTool::deactivate().
| int KisToolCrop::decoration | ( | ) | const |
Definition at line 523 of file kis_tool_crop.cc.
References m_decoration.
|
signal |
|
private |
Definition at line 540 of file kis_tool_crop.cc.
References m_lastCanvasUpdateRect, and KisTool::updateCanvasViewRect().
|
private |
Definition at line 902 of file kis_tool_crop.cc.
References DecorationLine::end, DecorationLine::endXRelation, DecorationLine::endYRelation, DecorationLine::Height, DecorationLine::Largest, p, DecorationLine::Smallest, DecorationLine::start, DecorationLine::startXRelation, DecorationLine::startYRelation, and DecorationLine::Width.
|
overridevirtual |
Called by KisToolProxy when the primary action is being finished, that is while mouseRelease or tabletRelease event. If the tool has ignored the event in beginPrimaryAction(), this method will not be called.
Reimplemented from KisTool.
Definition at line 351 of file kis_tool_crop.cc.
References KisImage::bounds(), bounds, CHECK_MODE_SANITY_OR_RETURN, KisTool::convertToPixelCoordAndSnap(), KisTool::HOVER_MODE, KisTool::image(), m_dragOffsetDoc, m_finalRect, m_handleSize, m_haveCropSelection, m_lastCanvasUpdateRect, m_resettingStroke, mouseOnHandle(), KisConstrainedRect::normalize(), KisTool::PAINT_MODE, KisTool::pixelToView(), KisConstrainedRect::rect(), KisTool::setMode(), setMoveResizeCursor(), KisConstrainedRect::setRectInitial(), and tryContinueLastCropAction().
| bool KisToolCrop::growCenter | ( | ) | const |
Definition at line 683 of file kis_tool_crop.cc.
References KisConstrainedRect::centered(), and m_finalRect.
|
private |
Definition at line 811 of file kis_tool_crop.cc.
References borderLineRect(), leftHandleRect(), lowerHandleRect(), lowerLeftHandleRect(), lowerRightHandleRect(), rightHandleRect(), upperHandleRect(), upperLeftHandleRect(), and upperRightHandleRect().
|
signal |
|
private |
Definition at line 806 of file kis_tool_crop.cc.
References m_handleSize.
| bool KisToolCrop::lockHeight | ( | ) | const |
Definition at line 654 of file kis_tool_crop.cc.
References KisConstrainedRect::heightLocked(), and m_finalRect.
|
signal |
| bool KisToolCrop::lockRatio | ( | ) | const |
Definition at line 711 of file kis_tool_crop.cc.
References m_finalRect, and KisConstrainedRect::ratioLocked().
|
signal |
| bool KisToolCrop::lockWidth | ( | ) | const |
Definition at line 626 of file kis_tool_crop.cc.
References m_finalRect, and KisConstrainedRect::widthLocked().
|
signal |
|
private |
Definition at line 791 of file kis_tool_crop.cc.
References m_handleSize.
|
private |
Definition at line 781 of file kis_tool_crop.cc.
References m_handleSize.
|
private |
Definition at line 771 of file kis_tool_crop.cc.
References m_handleSize.
|
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.
Definition at line 380 of file kis_tool_crop.cc.
References KisTool::convertToPixelCoordAndSnap(), m_haveCropSelection, m_mouseOnHandleType, KisTool::mode(), mouseOnHandle(), KisTool::PAINT_MODE, KisTool::pixelToView(), and setMoveResizeCursor().
|
private |
Definition at line 828 of file kis_tool_crop.cc.
References borderLineRect(), Inside, Left, leftHandleRect(), Lower, lowerHandleRect(), LowerLeft, lowerLeftHandleRect(), LowerRight, lowerRightHandleRect(), m_haveCropSelection, None, Right, rightHandleRect(), Upper, upperHandleRect(), UpperLeft, upperLeftHandleRect(), UpperRight, and upperRightHandleRect().
|
overridevirtual |
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.
Definition at line 232 of file kis_tool_crop.cc.
References paintOutlineWithHandles().
|
private |
Definition at line 422 of file kis_tool_crop.cc.
References borderLineRect(), bounds, Private::canvas, KoToolBase::decorationThickness(), decors, decorsIndex, drawDecorationLine(), HANDLE_BORDER_LINE_WIDTH, handlesPath(), KisTool::image(), m_decoration, m_haveCropSelection, KisTool::mode(), OUTSIDE_CROP_ALPHA, KisTool::PAINT_MODE, and KisTool::pixelToView().
|
overridevirtual |
Reimplemented from KoToolBase.
Definition at line 238 of file kis_tool_crop.cc.
References allowGrow(), applyCrop, centerToggleOption, growCenter(), growToggleOption, lockHeight, lockHeightToggleOption, lockRatio, lockRatioToggleOption, lockWidth, lockWidthToggleOption, m_contextMenu, and m_haveCropSelection.
|
private |
| double KisToolCrop::ratio | ( | ) | const |
Definition at line 701 of file kis_tool_crop.cc.
References m_finalRect, and KisConstrainedRect::ratio().
|
signal |
|
overrideslot |
Definition at line 210 of file kis_tool_crop.cc.
References cancelStroke().
|
overrideslot |
Definition at line 200 of file kis_tool_crop.cc.
References cancelStroke().
|
overrideslot |
Definition at line 195 of file kis_tool_crop.cc.
References crop(), and m_haveCropSelection.
|
overrideslot |
Definition at line 205 of file kis_tool_crop.cc.
References cancelStroke().
|
private |
Definition at line 796 of file kis_tool_crop.cc.
References m_handleSize.
|
slot |
Definition at line 659 of file kis_tool_crop.cc.
References bounds, canGrowChanged(), configGroup, KisTool::image(), m_finalRect, KisConstrainedRect::setCanGrow(), and KisConstrainedRect::setCropRect().
|
slot |
Definition at line 631 of file kis_tool_crop.cc.
References bounds, KisTool::image(), m_finalRect, m_haveCropSelection, KisConstrainedRect::rect(), KisConstrainedRect::setHeight(), and KisConstrainedRect::setRectInitial().
|
slot |
Definition at line 494 of file kis_tool_crop.cc.
References configGroup, cropType, cropTypeChanged(), and m_cropType.
|
slot |
Definition at line 489 of file kis_tool_crop.cc.
References cropType, and setCropType().
|
slot |
Definition at line 510 of file kis_tool_crop.cc.
References cropTypeSelectableChanged(), and m_cropTypeSelectable.
|
slot |
Definition at line 603 of file kis_tool_crop.cc.
References bounds, KisTool::image(), m_finalRect, m_haveCropSelection, KisConstrainedRect::rect(), KisConstrainedRect::setRectInitial(), and KisConstrainedRect::setWidth().
|
slot |
Definition at line 563 of file kis_tool_crop.cc.
References bounds, KisTool::image(), m_finalRect, m_haveCropSelection, KisConstrainedRect::rect(), KisConstrainedRect::setOffset(), and KisConstrainedRect::setRectInitial().
|
slot |
Definition at line 583 of file kis_tool_crop.cc.
References bounds, KisTool::image(), m_finalRect, m_haveCropSelection, KisConstrainedRect::rect(), KisConstrainedRect::setOffset(), and KisConstrainedRect::setRectInitial().
|
slot |
Definition at line 528 of file kis_tool_crop.cc.
References boundingRect(), configGroup, decoration, DECORATION_COUNT, decorationChanged(), m_decoration, and KisTool::updateCanvasViewRect().
|
slot |
Definition at line 673 of file kis_tool_crop.cc.
References configGroup, isCenteredChanged(), m_finalRect, KisConstrainedRect::setCentered(), and value().
|
slot |
Definition at line 649 of file kis_tool_crop.cc.
References m_finalRect, and KisConstrainedRect::setHeightLocked().
|
slot |
Definition at line 706 of file kis_tool_crop.cc.
References m_finalRect, and KisConstrainedRect::setRatioLocked().
|
slot |
Definition at line 621 of file kis_tool_crop.cc.
References m_finalRect, and KisConstrainedRect::setWidthLocked().
|
private |
Definition at line 860 of file kis_tool_crop.cc.
References KisCursor::arrowCursor(), KisTool::cursor, Inside, Left, Lower, LowerLeft, LowerRight, m_haveCropSelection, Right, KisCursor::sizeAllCursor(), KisCursor::sizeBDiagCursor(), KisCursor::sizeFDiagCursor(), KisCursor::sizeHorCursor(), KisCursor::sizeVerCursor(), Upper, UpperLeft, UpperRight, and KoToolBase::useCursor().
|
slot |
Definition at line 688 of file kis_tool_crop.cc.
References bounds, KisTool::image(), m_finalRect, m_haveCropSelection, KisConstrainedRect::ratio(), ratio, KisConstrainedRect::setRatio(), and KisConstrainedRect::setRectInitial().
|
slot |
Definition at line 716 of file kis_tool_crop.cc.
References Private::canvas, KisFloatingMessage::High, m_mouseOnHandleType, optionsWidget, KisViewManager::showFloatingMessage(), and KisCanvas2::viewManager().
|
slot |
Definition at line 546 of file kis_tool_crop.cc.
References allowGrow(), boundingRect(), canGrowChanged(), cropHeight, cropHeightChanged(), cropWidth, cropWidthChanged(), cropX, cropXChanged(), cropY, cropYChanged(), doCanvasUpdate(), growCenter(), isCenteredChanged(), lockHeight, lockHeightChanged(), lockRatio, lockRatioChanged(), lockWidth, lockWidthChanged(), ratio, and ratioChanged().
|
private |
Definition at line 316 of file kis_tool_crop.cc.
References KisCropSavedExtraData::CROP_IMAGE, KisCropSavedExtraData::CROP_LAYER, KisCropSavedExtraData::cropNode(), KisCropSavedExtraData::cropRect(), KisTool::currentNode(), KUndo2Command::extraData(), KisTool::image(), ImageCropType, LayerCropType, m_cropType, m_finalRect, m_haveCropSelection, KisUndoAdapter::presentCommand(), KisCropSavedExtraData::RESIZE_IMAGE, KisConstrainedRect::setRectInitial(), KisCropSavedExtraData::type(), KisImage::undoAdapter(), KisUndoAdapter::undoLastCommand(), and KisImage::waitForDone().
|
private |
Definition at line 801 of file kis_tool_crop.cc.
References m_handleSize.
|
private |
Definition at line 786 of file kis_tool_crop.cc.
References m_handleSize.
|
private |
Definition at line 776 of file kis_tool_crop.cc.
References m_handleSize.
|
private |
Definition at line 183 of file kis_tool_crop.h.
|
private |
Definition at line 184 of file kis_tool_crop.h.
|
private |
Definition at line 179 of file kis_tool_crop.h.
|
private |
Definition at line 185 of file kis_tool_crop.h.
|
private |
Definition at line 187 of file kis_tool_crop.h.
|
private |
Definition at line 188 of file kis_tool_crop.h.
|
private |
Definition at line 186 of file kis_tool_crop.h.
|
private |
Definition at line 182 of file kis_tool_crop.h.
|
private |
Definition at line 172 of file kis_tool_crop.h.
|
private |
Definition at line 173 of file kis_tool_crop.h.
|
private |
Definition at line 175 of file kis_tool_crop.h.
|
private |
Definition at line 202 of file kis_tool_crop.h.
|
private |
Definition at line 206 of file kis_tool_crop.h.
|
private |
Definition at line 166 of file kis_tool_crop.h.
|
private |
Definition at line 204 of file kis_tool_crop.h.
|
private |
Definition at line 168 of file kis_tool_crop.h.
|
private |
Definition at line 169 of file kis_tool_crop.h.
|
private |
Definition at line 205 of file kis_tool_crop.h.
|
private |
Definition at line 177 of file kis_tool_crop.h.
|
private |
Definition at line 170 of file kis_tool_crop.h.
|
private |
Definition at line 176 of file kis_tool_crop.h.
|
private |
Definition at line 180 of file kis_tool_crop.h.
|
readwrite |
Definition at line 47 of file kis_tool_crop.h.
|
readwrite |
Definition at line 41 of file kis_tool_crop.h.
|
readwrite |
Definition at line 42 of file kis_tool_crop.h.
|
readwrite |
Definition at line 45 of file kis_tool_crop.h.
|
readwrite |
Definition at line 43 of file kis_tool_crop.h.
|
readwrite |
Definition at line 44 of file kis_tool_crop.h.
|
readwrite |
Definition at line 51 of file kis_tool_crop.h.
|
readwrite |
Definition at line 48 of file kis_tool_crop.h.
|
readwrite |
Definition at line 50 of file kis_tool_crop.h.
|
readwrite |
Definition at line 46 of file kis_tool_crop.h.
|
readwrite |
Definition at line 49 of file kis_tool_crop.h.