fixed bugs regarding circular primitives

Sun, 10 Jun 2018 23:07:24 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 10 Jun 2018 23:07:24 +0300
changeset 1401
59b578c77111
parent 1400
ae83213bdd63
child 1402
8bbf2af8c3f5

fixed bugs regarding circular primitives

src/editmodes/circleMode.cpp file | annotate | diff | comparison | revisions
src/linetypes/circularprimitive.cpp file | annotate | diff | comparison | revisions
src/primitives.h file | annotate | diff | comparison | revisions
--- a/src/editmodes/circleMode.cpp	Sun Jun 10 21:48:58 2018 +0300
+++ b/src/editmodes/circleMode.cpp	Sun Jun 10 23:07:24 2018 +0300
@@ -105,6 +105,7 @@
 		Matrix transform = Matrix::fromQMatrix(renderer()->currentCamera().transformationMatrix(1));
 		transform *= Matrix::scaleMatrix(dist0);
 		model.emplace<LDCircularPrimitive>(PrimitiveModel::Circle, segments, divisions, transform, displacement);
+		finishDraw(model);
 		return;
 	}
 	else if (qFuzzyCompare(dist0, 0) or qFuzzyCompare(dist1, 0))
@@ -114,6 +115,7 @@
 		Matrix transform = Matrix::fromQMatrix(renderer()->currentCamera().transformationMatrix(1));
 		transform *= Matrix::scaleMatrix(max(dist0, dist1));
 		model.emplace<LDCircularPrimitive>(PrimitiveModel::Disc, segments, divisions, transform, displacement);
+		finishDraw(model);
 		return;
 	}
 	else if (g_RingFinder.findRings(dist0, dist1)) // Consult the ring finder now
--- a/src/linetypes/circularprimitive.cpp	Sun Jun 10 21:48:58 2018 +0300
+++ b/src/linetypes/circularprimitive.cpp	Sun Jun 10 23:07:24 2018 +0300
@@ -201,5 +201,5 @@
 void LDCircularPrimitive::serialize(class Serializer& serializer)
 {
 	LDMatrixObject::serialize(serializer);
-	serializer << m_segments << m_divisions;
+	serializer << m_segments << m_divisions << m_type;
 }
--- a/src/primitives.h	Sun Jun 10 21:48:58 2018 +0300
+++ b/src/primitives.h	Sun Jun 10 23:07:24 2018 +0300
@@ -63,6 +63,8 @@
 	QString makeFileName(FilenameStyle style) const;
 };
 
+Q_DECLARE_METATYPE(PrimitiveModel::Type)
+
 class PrimitiveCategory : public QObject
 {
 	Q_OBJECT

mercurial