30 qreal scaleX, qreal scaleY,
31 const QPointF &absoluteStillPoint,
34 const QTransform &postScalingCoveringTransform,
36 : SkipFirstRedoBase(false,
kundo2_i18n(
"Resize"), parent),
43 m_d->useGlobalMode = useGLobalMode;
61 for (
auto it = updates.begin(); it != updates.end(); ++it) {
62 it.key()->updateAbsolute(it.value());
70 for (
auto it = updates.begin(); it != updates.end(); ++it) {
71 it.key()->updateAbsolute(it.value());
77 QMap<KoShape*,QRectF> updates;
84 m_d->absoluteStillPoint,
87 m_d->postScalingCoveringTransform);
97 QMap<KoShape*,QRectF> updates;
99 for (
int i = 0; i <
m_d->shapes.size(); i++) {
122 other->
m_d->absoluteStillPoint !=
m_d->absoluteStillPoint ||
123 other->
m_d->shapes !=
m_d->shapes ||
124 other->
m_d->useGlobalMode !=
m_d->useGlobalMode ||
125 other->
m_d->usePostScaling !=
m_d->usePostScaling) {
131 if (
m_d->useGlobalMode && !
m_d->usePostScaling) {
140 m_d->scaleX *= other->
m_d->scaleX;
141 m_d->scaleY *= other->
m_d->scaleY;
147 const QMap<KoShape*, QRectF> undoUpdates =
undoNoUpdate();
153 const QMap<KoShape*, QRectF> redoUpdates =
redoNoUpdate();
157 for (
auto it = undoUpdates.begin(); it != undoUpdates.end(); ++it) {
159 it.key()->updateAbsolute(it.value() | redoUpdates[it.key()]);
virtual QSizeF size() const
Get the size of the shape in pt.
virtual QRectF boundingRect() const
Get the bounding box of the shape.
void setTransformation(const QTransform &matrix)
QTransform transformation() const
Returns the shapes local transformation matrix.
virtual void setSize(const QSizeF &size)
Resize the shape.
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
KUndo2MagicString kundo2_i18n(const char *text)
KRITAFLAKE_EXPORT Qt::Orientation significantScaleOrientation(qreal scaleX, qreal scaleY)
KRITAFLAKE_EXPORT void resizeShapeCommon(KoShape *shape, qreal scaleX, qreal scaleY, const QPointF &absoluteStillPoint, bool useGlobalMode, bool usePostScaling, const QTransform &postScalingCoveringTransform)
QMap< KoShape *, QRectF > redoNoUpdate()
bool mergeWith(const KUndo2Command *command) override
QList< KoShape * > shapes
QTransform postScalingCoveringTransform
QList< QTransform > oldTransforms
KoShapeResizeCommand(const QList< KoShape * > &shapes, qreal scaleX, qreal scaleY, const QPointF &absoluteStillPoint, bool useGLobalMode, bool usePostScaling, const QTransform &postScalingCoveringTransform, KUndo2Command *parent=0)
~KoShapeResizeCommand() override
void replaceResizeAction(qreal scaleX, qreal scaleY, const QPointF &absoluteStillPoint)
QScopedPointer< Private > const m_d
QMap< KoShape *, QRectF > undoNoUpdate()
QPointF absoluteStillPoint