forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user