From b3d7158e8e53e5c4c9782c17b7b65faffe6d03c3 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 12 Jun 2020 03:27:36 +1000 Subject: [PATCH] matrix: ensure an identity matrix is created if all values are default --- app/node/generator/matrix/matrix.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/node/generator/matrix/matrix.cpp b/app/node/generator/matrix/matrix.cpp index 5dbfe7377..b35247276 100644 --- a/app/node/generator/matrix/matrix.cpp +++ b/app/node/generator/matrix/matrix.cpp @@ -248,13 +248,14 @@ QMatrix4x4 MatrixGenerator::GenerateMatrix(const QVector2D& pos, // Rotation mat.rotate(rot, 0, 0, 1); - // Scale + // Scale (convert to a QVector3D so that the identity matrix is preserved if all values are 1.0f) + QVector3D full_scale; if (uniform_scale) { - QVector2D uniformed(scale.x(), scale.x()); - mat.scale(uniformed); + full_scale = QVector3D(scale.x(), scale.x(), 1.0f); } else { - mat.scale(scale); + full_scale = QVector3D(scale, 1.0f); } + mat.scale(full_scale); // Anchor Point mat.translate(-anchor);