11#include <klocalizedstring.h>
31 Q_ASSERT(
d->shapes.count() ==
d->previousPositions.count());
32 Q_ASSERT(
d->shapes.count() ==
d->newPositions.count());
42 Q_FOREACH (
KoShape *shape,
d->shapes) {
45 d->previousPositions << pos;
46 d->newPositions << pos + offset;
59 for (
int i = 0; i <
d->shapes.count(); i++) {
71 for (
int i = 0; i <
d->shapes.count(); i++) {
90 if (other->
d->shapes !=
d->shapes ||
91 other->
d->anchor !=
d->anchor) {
96 d->newPositions = other->
d->newPositions;
The undo / redo command for shape moving.
void undo() override
revert the actions done in redo
QList< KoShape * > shapes
KoFlake::AnchorPosition anchor
~KoShapeMoveCommand() override
bool mergeWith(const KUndo2Command *command) override
void redo() override
redo the command
KoShapeMoveCommand(const QList< KoShape * > &shapes, QList< QPointF > &previousPositions, QList< QPointF > &newPositions, KoFlake::AnchorPosition anchor=KoFlake::Center, KUndo2Command *parent=0)
QList< QPointF > newPositions
QList< QPointF > previousPositions
QPointF absolutePosition(KoFlake::AnchorPosition anchor=KoFlake::Center) const
virtual QRectF boundingRect() const
Get the bounding box of the shape.
virtual void updateAbsolute(const QRectF &rect) const
void setAbsolutePosition(const QPointF &newPosition, KoFlake::AnchorPosition anchor=KoFlake::Center)
KUndo2MagicString kundo2_i18n(const char *text)