unify calls to "setRotation" for element-primitives

This commit is contained in:
plc-user
2025-02-22 09:30:15 +01:00
parent 181680e6f1
commit 43386aa14f
9 changed files with 44 additions and 32 deletions

View File

@@ -67,8 +67,9 @@ QString PartDynamicTextField::xmlName() const
@param angle
*/
void PartDynamicTextField::setRotation(qreal angle) {
QGraphicsObject::setRotation(QET::correctAngle(rotation()+angle, true));
setPos(QTransform().rotate(angle).map(pos()));
qreal diffAngle = qRound((angle - rotation()) * 100.0) / 100.0;
QGraphicsObject::setRotation(QET::correctAngle(angle, true));
setPos(QTransform().rotate(diffAngle).map(pos()));
}
void PartDynamicTextField::mirror() {