|
Krita Source Code Documentation
|
#include <ShapeResizeStrategy.h>
Inheritance diagram for ShapeResizeStrategy:Public Member Functions | |
| KUndo2Command * | createCommand () override |
| void | finishInteraction (Qt::KeyboardModifiers modifiers) override |
| void | handleMouseMove (const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers) override |
| void | paint (QPainter &painter, const KoViewConverter &converter) override |
| ShapeResizeStrategy (KoToolBase *tool, KoSelection *selection, const QPointF &clicked, KoFlake::SelectionHandle direction, bool forceUniformScalingMode) | |
| ~ShapeResizeStrategy () override | |
Public Member Functions inherited from KoInteractionStrategy | |
| virtual void | cancelInteraction () |
| KoInteractionStrategy (KoToolBase *parent) | |
| constructor | |
| KoToolBase * | tool () const |
| virtual | ~KoInteractionStrategy () |
| Destructor. | |
Private Member Functions | |
| void | resizeBy (const QPointF &stillPoint, qreal zoomX, qreal zoomY) |
Private Attributes | |
| bool | m_bottom {false} |
| QScopedPointer< KoShapeResizeCommand > | m_executedCommand |
| bool | m_forceUniformScalingMode {false} |
| QPointF | m_globalCenterPoint |
| QPointF | m_globalStillPoint |
| QSizeF | m_initialSelectionSize |
| bool | m_left {false} |
| QTransform | m_postScalingCoveringTransform |
| bool | m_right {false} |
| QList< KoShape * > | m_selectedShapes |
| QPointF | m_start |
| bool | m_top {false} |
| QTransform | m_unwindMatrix |
Additional Inherited Members | |
Protected Member Functions inherited from KoInteractionStrategy | |
| uint | decorationThickness () const |
| uint | grabSensitivity () const |
| Convenience function to get the global grab sensitivity. | |
| uint | handleRadius () const |
| Convenience function to get the global handle radius. | |
| KoInteractionStrategy (KoInteractionStrategyPrivate &) | |
| constructor | |
Protected Attributes inherited from KoInteractionStrategy | |
| KoInteractionStrategyPrivate * | d_ptr |
A strategy for the KoInteractionTool. This strategy is invoked when the user starts a resize of a selection of objects, the strategy will then resize the objects interactively and provide a command afterwards.
Definition at line 28 of file ShapeResizeStrategy.h.
| ShapeResizeStrategy::ShapeResizeStrategy | ( | KoToolBase * | tool, |
| KoSelection * | selection, | ||
| const QPointF & | clicked, | ||
| KoFlake::SelectionHandle | direction, | ||
| bool | forceUniformScalingMode ) |
Constructor
Definition at line 28 of file ShapeResizeStrategy.cpp.
References KoShape::absolutePosition(), KoShape::absoluteTransformation(), KoFlake::BottomLeft, KoFlake::BottomLeftHandle, KoFlake::BottomMiddleHandle, KoFlake::BottomRight, KoFlake::BottomRightHandle, KoToolBase::canvas(), KoFlake::Center, KoSelection::count(), KIS_SAFE_ASSERT_RECOVER_RETURN, KoFlake::LeftMiddleHandle, KoShape::linearizeSubtree(), m_bottom, m_globalCenterPoint, m_globalStillPoint, m_initialSelectionSize, m_left, m_postScalingCoveringTransform, m_right, m_selectedShapes, m_start, m_top, m_unwindMatrix, KoShape::outlineRect(), p0, KoFlake::RightMiddleHandle, KoSelection::selectedEditableShapes(), KoSnapGuide::setIgnoredShapes(), KoToolBase::setStatusText(), KoShape::size(), KoCanvasBase::snapGuide, KoInteractionStrategy::tool(), KoFlake::TopLeft, KoFlake::TopLeftHandle, KoFlake::TopMiddleHandle, KoFlake::TopRight, KoFlake::TopRightHandle, and KoShape::transformation().
|
override |
Definition at line 100 of file ShapeResizeStrategy.cpp.
|
overridevirtual |
For interactions that are undo-able this method should be implemented to return such a command. Implementations should return 0 otherwise.
Implements KoInteractionStrategy.
Definition at line 210 of file ShapeResizeStrategy.cpp.
References KoToolBase::canvas(), m_executedCommand, KoSnapGuide::reset(), KoCanvasBase::snapGuide, and KoInteractionStrategy::tool().
|
overridevirtual |
Override to make final changes to the data on the end of an interaction.
Implements KoInteractionStrategy.
Definition at line 221 of file ShapeResizeStrategy.cpp.
|
overridevirtual |
Extending classes should implement this method to update the selectedShapes based on the new mouse position.
| mouseLocation | the new location in pt |
| modifiers | OR-ed set of keys pressed. |
Do not let a shape be less than 1px in size in current view coordinates. If the user wants it to be smaller, he can just zoom-in a bit.
Implements KoInteractionStrategy.
Definition at line 105 of file ShapeResizeStrategy.cpp.
References KoToolBase::canvas(), distance(), KoShape::keepAspectRatio(), m_bottom, m_globalCenterPoint, m_globalStillPoint, m_initialSelectionSize, m_left, m_right, m_selectedShapes, m_start, m_top, m_unwindMatrix, resizeBy(), KisAlgebra2D::signPZ(), KoSnapGuide::snap(), KoCanvasBase::snapGuide, KoInteractionStrategy::tool(), KoCanvasBase::viewConverter(), and KoViewConverter::viewToDocument().
|
overridevirtual |
Reimplement this if the action needs to draw a "blob" on the canvas; that is, a transient decoration like a rubber band.
Reimplemented from KoInteractionStrategy.
Definition at line 226 of file ShapeResizeStrategy.cpp.
|
private |
Definition at line 193 of file ShapeResizeStrategy.cpp.
References m_executedCommand, m_forceUniformScalingMode, m_postScalingCoveringTransform, and m_selectedShapes.
|
private |
Definition at line 52 of file ShapeResizeStrategy.h.
|
private |
Definition at line 57 of file ShapeResizeStrategy.h.
|
private |
Definition at line 59 of file ShapeResizeStrategy.h.
|
private |
Definition at line 56 of file ShapeResizeStrategy.h.
|
private |
Definition at line 55 of file ShapeResizeStrategy.h.
|
private |
Definition at line 48 of file ShapeResizeStrategy.h.
|
private |
Definition at line 51 of file ShapeResizeStrategy.h.
|
private |
Definition at line 47 of file ShapeResizeStrategy.h.
|
private |
Definition at line 53 of file ShapeResizeStrategy.h.
Definition at line 45 of file ShapeResizeStrategy.h.
|
private |
Definition at line 44 of file ShapeResizeStrategy.h.
|
private |
Definition at line 50 of file ShapeResizeStrategy.h.
|
private |
Definition at line 49 of file ShapeResizeStrategy.h.