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

@@ -579,9 +579,10 @@ void PartLine::setSecondEndLength(const qreal &l)
}
void PartLine::setRotation(qreal angle) {
m_rot += angle;
m_line.setP1(QTransform().rotate(angle).map(m_line.p1()));
m_line.setP2(QTransform().rotate(angle).map(m_line.p2()));
qreal diffAngle = qRound((angle - rotation()) * 100.0) / 100.0;
m_rot = QET::correctAngle(angle, true);
m_line.setP1(QTransform().rotate(diffAngle).map(m_line.p1()));
m_line.setP2(QTransform().rotate(diffAngle).map(m_line.p2()));
prepareGeometryChange();
setLine(m_line);
adjustHandlerPos();