simplified

Tue, 19 Jun 2018 23:59:05 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Tue, 19 Jun 2018 23:59:05 +0300
changeset 1414
04db55860880
parent 1413
6b0ca41c158f
child 1415
006ced515057

simplified

src/dialogs/circularprimitiveeditor.cpp file | annotate | diff | comparison | revisions
--- a/src/dialogs/circularprimitiveeditor.cpp	Tue Jun 19 23:56:07 2018 +0300
+++ b/src/dialogs/circularprimitiveeditor.cpp	Tue Jun 19 23:59:05 2018 +0300
@@ -196,15 +196,16 @@
 		primitive->restore(originalState); // Restoring does not change 'originalState'
 }
 
+/*
+ * Rotates the primitive around its origin. The angle depends on its resolution and the passed 'factor' parameter.
+ */
 void CircularPrimitiveEditor::rotate(double factor)
 {
 	if (primitive)
 	{
 		double angle = factor * 360.0 / primitive->divisions();
-
-		QQuaternion rotation = QQuaternion::fromAxisAndAngle({0.0f, 1.0f, 0.0f}, angle);
 		QMatrix4x4 matrix = primitive->transformationMatrix();
-		matrix.rotate(rotation);
+		matrix.rotate(QQuaternion::fromAxisAndAngle({0.0f, 1.0f, 0.0f}, angle));
 		primitive->setTransformationMatrix(matrix);
 	}
 }

mercurial