clean some code

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5279 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2018-03-25 18:42:18 +00:00
parent d44ead205b
commit 37ef43b97b
6 changed files with 11 additions and 47 deletions

View File

@@ -24,6 +24,7 @@
#include "diagramimageitem.h"
#include "diagram.h"
#include "conductor.h"
#include "qet.h"
#include <QGraphicsItem>
@@ -87,12 +88,12 @@ void RotateSelectionCommand::undo()
ConductorTextItem *cti = static_cast<ConductorTextItem *>(text.data());
cti->forceRotateByUser(m_rotate_by_user.value(text.data()));
if(cti->wasRotateByUser())
cti->rotateBy(-m_angle);
cti->setRotation(cti->rotation() - m_angle);
else
cti->parentConductor()->calculateTextItemPosition();
}
else
text.data()->rotateBy(-m_angle);
text.data()->setRotation(text.data()->rotation() - m_angle);
}
}
for(QPointer<DiagramImageItem> image : m_image)
@@ -123,7 +124,7 @@ void RotateSelectionCommand::redo()
m_rotate_by_user.insert(text.data(), cti->wasRotateByUser());
cti->forceRotateByUser(true);
}
text.data()->rotateBy(m_angle);
text.data()->setRotation(text.data()->rotation() + m_angle);
}
}
for(QPointer<DiagramImageItem> image : m_image)