From 0758b58ceb1d23e0cef4c80df2a601ed963cdb84 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 3 Dec 2019 17:22:11 +0200 Subject: [PATCH] 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 Reviewed-by: Thomas Hartmann --- .../qml/qmlpuppet/qml2puppet/editor3d/mousearea3d.cpp | 6 +++--- 1 file 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 3dd360e1ea1..71a67a95772 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;