start work to define if conductor text item was moved by user or not

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2229 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2013-06-09 19:09:27 +00:00
parent c3aedf2a16
commit d91d60aed2
4 changed files with 50 additions and 3 deletions

View File

@@ -601,7 +601,18 @@ void RotateElementsCommand::undo() {
rotateElement(e, elements_to_rotate[e]);
}
foreach(DiagramTextItem *dti, texts_to_rotate) {
dti -> rotateBy(-applied_rotation_angle_);
//ConductorTextItem have got a default rotation propertie
//so we apply specific undo method for him
if (ConductorTextItem *cti = qgraphicsitem_cast<ConductorTextItem *>(dti)) {
cti -> forceRotateByUser(previous_rotate_by_user_);
//previous_rotate_by_user is false mean the rotation is propertie rotation
if (previous_rotate_by_user_ == false) {cti -> parentConductor() ->adjustTextItemPosition();}
else {cti -> rotateBy(-applied_rotation_angle_);}
}
//this isn't a ConductorTextItem
else {
dti -> rotateBy(-applied_rotation_angle_);
}
}
}
@@ -611,6 +622,10 @@ void RotateElementsCommand::redo() {
rotateElement(e, e -> orientation().next());
}
foreach(DiagramTextItem *dti, texts_to_rotate) {
if (ConductorTextItem *cti = qgraphicsitem_cast<ConductorTextItem *>(dti)) {
previous_rotate_by_user_ = cti -> wasRotateByUser();
cti -> forceRotateByUser(true);
}
dti -> rotateBy(applied_rotation_angle_);
}
}