13#include <klocalizedstring.h>
35 Q_FOREACH (
KoShape *shape, shapes) {
43 previousPositions << position;
47 delta = QPointF(boundingRect.left(), bRect.y()) - bRect.topLeft();
50 delta = QPointF(boundingRect.center().x() - bRect.width() / 2, bRect.y()) - bRect.topLeft();
53 delta = QPointF(boundingRect.right() - bRect.width(), bRect.y()) - bRect.topLeft();
56 delta = QPointF(bRect.x(), boundingRect.top()) - bRect.topLeft();
59 delta = QPointF(bRect.x(), boundingRect.center().y() - bRect.height() / 2) - bRect.topLeft();
62 delta = QPointF(bRect.x(), boundingRect.bottom() - bRect.height()) - bRect.topLeft();
65 newPositions << position + delta;
void setText(const KUndo2MagicString &text)
The undo / redo command for aligning shapes.
void undo() override
revert the actions done in redo
KoShapeMoveCommand * command
void redo() override
redo the command
Align
The different alignment options for this command.
@ VerticalTopAlignment
Align top.
@ VerticalCenterAlignment
Align centered vertically.
@ HorizontalLeftAlignment
Align left.
@ HorizontalCenterAlignment
Align Centered horizontally.
@ VerticalBottomAlignment
Align bottom.
@ HorizontalRightAlignment
Align Right.
KoShapeAlignCommand(const QList< KoShape * > &shapes, Align align, const QRectF &boundingRect, KUndo2Command *parent=0)
~KoShapeAlignCommand() override
The undo / redo command for shape moving.
QPointF absolutePosition(KoFlake::AnchorPosition anchor=KoFlake::Center) const
QRectF absoluteOutlineRect() const
KUndo2MagicString kundo2_i18n(const char *text)