diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-12-12 15:46:22 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-12-13 09:27:59 +0000 |
commit | 49da199b10a87d0698e9f6ac3f8eafdc3c05bdc2 (patch) | |
tree | 7c087cd8805e44810a1b7bbff618beae7bfbc2c0 /share | |
parent | eb09e814db4e76227c8034692cb0f162536faee8 (diff) | |
download | qt-creator-49da199b10a87d0698e9f6ac3f8eafdc3c05bdc2.tar.gz |
Fix rotation resulting in NaN angle sometimes
Change-Id: I88f866c6649f7ec25bc96a7393d0930685e5382b
Fixes: QDS-1341
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp index 4c85557634..a0f54d1cc0 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp @@ -358,6 +358,11 @@ qreal QmlDesigner::Internal::MouseArea3D::getNewRotationAngle( QQuick3DNode *node, const QVector3D &pressPos, const QVector3D ¤tPos, const QVector3D &nodePos, qreal prevAngle, bool trackBall) { + const QVector3D dragVector = currentPos - pressPos; + + if (dragVector.length() < 0.001f) + return prevAngle; + // Get camera to node direction in node orientation QVector3D cameraToNodeDir = getCameraToNodeDir(node); if (trackBall) { |