|
Krita Source Code Documentation
|
#include <KisSnapPointStrategy.h>
Inheritance diagram for KisSnapPointStrategy:Classes | |
| struct | Private |
Public Member Functions | |
| void | addPoint (const QPointF &pt) |
| QPainterPath | decoration (const KoViewConverter &converter) const override |
| returns the current snap strategy decoration | |
| KisSnapPointStrategy (KoSnapGuide::Strategy type=KoSnapGuide::CustomSnapping) | |
| bool | snap (const QPointF &mousePosition, KoSnapProxy *proxy, qreal maxSnapDistance) override |
| ~KisSnapPointStrategy () override | |
Public Member Functions inherited from KoSnapStrategy | |
| KoSnapStrategy (KoSnapGuide::Strategy type) | |
| QPointF | snappedPosition () const |
| returns the snapped position form the last call to snapToPoints | |
| SnapType | snappedType () const |
| KoSnapGuide::Strategy | type () const |
| returns the strategies type | |
| virtual | ~KoSnapStrategy () |
Private Attributes | |
| const QScopedPointer< Private > | m_d |
Additional Inherited Members | |
Public Types inherited from KoSnapStrategy | |
| enum | SnapType { ToPoint = 0 , ToLine } |
Static Public Member Functions inherited from KoSnapStrategy | |
| static qreal | scalarProduct (const QPointF &p1, const QPointF &p2) |
| static qreal | squareDistance (const QPointF &p1, const QPointF &p2) |
Protected Member Functions inherited from KoSnapStrategy | |
| void | setSnappedPosition (const QPointF &position, SnapType snapType) |
| sets the current snapped position | |
The KisSnapPointStrategy class is a custom strategy that allows snapping to arbitrary points on canvas, not linked to any real objects. It can be used, for example, for snapping to the previous position of the handle, while it is dragging by the user.
Definition at line 22 of file KisSnapPointStrategy.h.
| KisSnapPointStrategy::KisSnapPointStrategy | ( | KoSnapGuide::Strategy | type = KoSnapGuide::CustomSnapping | ) |
Definition at line 18 of file KisSnapPointStrategy.cpp.
|
override |
Definition at line 24 of file KisSnapPointStrategy.cpp.
| void KisSnapPointStrategy::addPoint | ( | const QPointF & | pt | ) |
Definition at line 57 of file KisSnapPointStrategy.cpp.
References m_d.
|
overridevirtual |
returns the current snap strategy decoration
Implements KoSnapStrategy.
Definition at line 48 of file KisSnapPointStrategy.cpp.
References decoration(), KoSnapStrategy::snappedPosition(), and KoViewConverter::viewToDocument().
|
overridevirtual |
Implements KoSnapStrategy.
Definition at line 28 of file KisSnapPointStrategy.cpp.
References kisDistance(), m_d, KoSnapStrategy::setSnappedPosition(), and KoSnapStrategy::ToPoint.
|
private |
Definition at line 35 of file KisSnapPointStrategy.h.