summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2019-12-03 17:22:11 +0200
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2019-12-04 09:54:37 +0000
commit0758b58ceb1d23e0cef4c80df2a601ed963cdb84 (patch)
tree11905ece850f86eabe0aef9a3929215840b27421
parent4ce7f39e4e0029d5a221b047c151ad1107f1194d (diff)
downloadqt-creator-0758b58ceb1d23e0cef4c80df2a601ed963cdb84.tar.gz
QmlDesigner: Fix planar scaling randomly setting the third axis to zero
All the math before checking if the scaling axis is zero can cause enough rounding errors to make qFuzzyIsNull to not think the value is zero anymore, so check increase the check range. Change-Id: I776d44886f061be6c1fd91c09eb8efcfb29e0936 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp
index 3dd360e1ea..71a67a9577 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp
@@ -322,11 +322,11 @@ QVector3D MouseArea3D::getNewScale(QQuick3DNode *node, const QVector3D &startSca
scaleVec *= magnitude;
// Zero axes on scale vector indicate directions we don't want scaling to affect
- if (qFuzzyIsNull(scaleVec.x()))
+ if (scaleDirVector.x() < 0.0001f)
scaleVec.setX(1.f);
- if (qFuzzyIsNull(scaleVec.y()))
+ if (scaleDirVector.y() < 0.0001f)
scaleVec.setY(1.f);
- if (qFuzzyIsNull(scaleVec.z()))
+ if (scaleDirVector.z() < 0.0001f)
scaleVec.setZ(1.f);
scaleVec *= startScale;