QmlDesigner: Allow snap back to 0 rotation during drag

Start rotation should be restored when desired angle for rotation is 0.

Fixes: QDS-10652
Change-Id: I8e733b714f6a0f14561c270aefc5049bdfaff39e
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2023-09-14 14:48:47 +03:00
parent 4b1862fdb1
commit 77a1c0fb15

View File

@@ -699,8 +699,8 @@ qreal QmlDesigner::Internal::MouseArea3D::getNewRotationAngle(
void QmlDesigner::Internal::MouseArea3D::applyRotationAngleToNode( void QmlDesigner::Internal::MouseArea3D::applyRotationAngleToNode(
QQuick3DNode *node, const QVector3D &startRotation, qreal angle) QQuick3DNode *node, const QVector3D &startRotation, qreal angle)
{ {
node->setEulerRotation(startRotation);
if (!qFuzzyIsNull(angle)) { if (!qFuzzyIsNull(angle)) {
node->setEulerRotation(startRotation);
QVector3D normal = getNormal(); QVector3D normal = getNormal();
node->rotate(qRadiansToDegrees(angle), normal, QQuick3DNode::SceneSpace); node->rotate(qRadiansToDegrees(angle), normal, QQuick3DNode::SceneSpace);
} }