9#include <klocalizedstring.h>
15 const QPointF &offset,
19 , m_pointData(pointData)
20 , m_pointType(pointType)
22 Q_ASSERT(offset.x() < 1e14 && offset.y() < 1e14);
50 direction /= sqrt(direction.x() * direction.x() + direction.y() * direction.y());
65 direction /= sqrt(direction.x() * direction.x() + direction.y() * direction.y());
qreal length(const QPointF &vec)
qreal distance(const QPointF &p1, const QPointF &p2)
void setText(const KUndo2MagicString &text)
The undo / redo command for path point moving.
KoPathPoint::PointType m_pointType
KoPathControlPointMoveCommand(const KoPathPointData &pointData, const QPointF &offset, KoPathPoint::PointType pointType, KUndo2Command *parent=0)
bool mergeWith(const KUndo2Command *command) override
KoPathPointData m_pointData
void undo() override
revert the actions done in redo
void redo() override
redo the command
Describe a KoPathPoint by a KoPathShape and its indices.
KoPathPointIndex pointIndex
position of the point in the path shape
KoPathShape * pathShape
path shape the path point belongs too
A KoPathPoint represents a point in a path.
PointProperties properties
void setControlPoint1(const QPointF &point)
Set the control point 1.
void setControlPoint2(const QPointF &point)
Set the control point 2.
@ IsSmooth
it is smooth, both control points on a line through the point
@ IsSymmetric
it is symmetric, like smooth but control points have same distance to point
PointType
the type for identifying part of a KoPathPoint
@ ControlPoint2
the second control point
@ ControlPoint1
the first control point
The position of a path point within a path shape.
virtual QPointF normalize()
Normalizes the path data.
QRectF boundingRect() const override
reimplemented
KoPathPoint * pointByIndex(const KoPathPointIndex &pointIndex) const
Returns the path point specified by a path point index.
virtual void updateAbsolute(const QRectF &rect) const
KUndo2MagicString kundo2_i18n(const char *text)
@ ChangePathShapeControlPointId