11#include <klocalizedstring.h>
21 QMap<KoPathPointData, QPointF >
points;
33 if (!
d->
points.contains(data)) {
44 Q_ASSERT(pointData.count() == offsets.count());
48 uint dataCount = pointData.count();
49 for (
uint i = 0; i < dataCount; ++i) {
51 if (!
d->
points.contains(data)) {
93 it.value() += other->
d->
points[it.key()];
102 QMap<KoShape*, QRectF> oldDirtyRects;
105 oldDirtyRects[path] = path->boundingRect();
108 QMap<KoPathPointData, QPointF>::iterator it(
points.begin());
109 for (; it !=
points.end(); ++it) {
112 QPointF shapeOffset = path->
documentToShape(factor*it.value()) - path->documentToShape(QPointF());
114 matrix.translate(shapeOffset.x(), shapeOffset.y());
116 KoPathPoint *
p = path->pointByIndex(it.key().pointIndex);
124 path->updateAbsolute(oldDirtyRects[path] | path->boundingRect());
void setText(const KUndo2MagicString &text)
Describe a KoPathPoint by a KoPathShape and its indices.
KoPathShape * pathShape
path shape the path point belongs too
QSet< KoPathShape * > paths
KoPathPointMoveCommandPrivate()
void applyOffset(qreal factor)
QMap< KoPathPointData, QPointF > points
The undo / redo command for path point moving.
void undo() override
revert the actions done in redo
bool mergeWith(const KUndo2Command *command) override
KoPathPointMoveCommandPrivate *const d
KoPathPointMoveCommand(const QList< KoPathPointData > &pointData, const QPointF &offset, KUndo2Command *parent=0)
~KoPathPointMoveCommand() override
void redo() override
redo the command
A KoPathPoint represents a point in a path.
void map(const QTransform &matrix)
apply matrix on the point
The position of a path point within a path shape.
QPointF documentToShape(const QPointF &point) const
Transforms point from document coordinates to shape coordinates.
KUndo2MagicString kundo2_i18n(const char *text)
bool compareListsUnordered(const QList< T > &a, const QList< T > &b)