diff --git a/sources/diagramcommands.cpp b/sources/diagramcommands.cpp index acba4aaf7..19337dd73 100644 --- a/sources/diagramcommands.cpp +++ b/sources/diagramcommands.cpp @@ -685,6 +685,9 @@ RotateTextsCommand::RotateTextsCommand(const QHash &p texts_to_rotate(previous_state), applied_rotation_angle_(applied_rotation) { + foreach(DiagramTextItem *text, texts_to_rotate.keys()) { + if (ConductorTextItem *cti = qgraphicsitem_cast(text)) previous_rotate_by_user_ = cti -> wasRotateByUser(); + } defineCommandName(); } @@ -699,6 +702,7 @@ RotateTextsCommand::RotateTextsCommand(const QList &texts, do applied_rotation_angle_(applied_rotation) { foreach(DiagramTextItem *text, texts) { + if (ConductorTextItem *cti = qgraphicsitem_cast(text)) previous_rotate_by_user_ = cti -> wasMovedByUser(); texts_to_rotate.insert(text, text -> rotationAngle()); } defineCommandName(); @@ -715,6 +719,9 @@ RotateTextsCommand::~RotateTextsCommand() { */ void RotateTextsCommand::undo() { foreach(DiagramTextItem *text, texts_to_rotate.keys()) { + if (ConductorTextItem *cti = qgraphicsitem_cast(text)) { + cti -> forceRotateByUser(previous_rotate_by_user_); + } text -> setRotationAngle(texts_to_rotate[text]); } } @@ -724,6 +731,10 @@ void RotateTextsCommand::undo() { */ void RotateTextsCommand::redo() { foreach(DiagramTextItem *text, texts_to_rotate.keys()) { + if (ConductorTextItem *cti = qgraphicsitem_cast(text)) { + previous_rotate_by_user_ = cti -> wasRotateByUser(); + cti -> forceRotateByUser(true); + } text -> setRotationAngle(applied_rotation_angle_); } } diff --git a/sources/diagramcommands.h b/sources/diagramcommands.h index f9d9fa443..f889bce67 100644 --- a/sources/diagramcommands.h +++ b/sources/diagramcommands.h @@ -353,6 +353,7 @@ class RotateTextsCommand : public QUndoCommand { QHash texts_to_rotate; /// angle of rotation of all text items after the command double applied_rotation_angle_; + bool previous_rotate_by_user_; }; /**