src/editmodes/drawMode.cpp

changeset 1217
314e12e23c3a
parent 1006
a6b462051ae0
child 1222
34def2630300
--- a/src/editmodes/drawMode.cpp	Thu Jan 04 19:40:52 2018 +0200
+++ b/src/editmodes/drawMode.cpp	Thu Jan 04 19:44:26 2018 +0200
@@ -22,15 +22,15 @@
 #include "../ldObject.h"
 #include "../glRenderer.h"
 
-DrawMode::DrawMode (GLRenderer* renderer) :
-	Super (renderer) {}
+DrawMode::DrawMode(GLRenderer* renderer) :
+	Super(renderer) {}
 
 EditModeType DrawMode::type() const
 {
 	return EditModeType::Draw;
 }
 
-void DrawMode::render (QPainter& painter) const
+void DrawMode::render(QPainter& painter) const
 {
 	QVector<Vertex> poly;
 
@@ -41,10 +41,10 @@
 	if (poly.size() < 4)
 		poly << getCursorVertex();
 
-	renderPolygon (painter, poly, true, true);
+	renderPolygon(painter, poly, true, true);
 }
 
-bool DrawMode::preAddVertex (Vertex const& pos)
+bool DrawMode::preAddVertex(Vertex const& pos)
 {
 	// If we picked an already-existing vertex, stop drawing
 	for (Vertex& vert : m_drawedVerts)
@@ -67,13 +67,13 @@
 	QList<Vertex>& verts = m_drawedVerts;
 	LDObjectList objs;
 
-	switch (verts.size())
+	switch(verts.size())
 	{
 		case 2:
 		{
 			// 2 verts - make a line
-			LDLine* obj = LDSpawn<LDLine> (verts[0], verts[1]);
-			obj->setColor (EdgeColor);
+			LDLine* obj = LDSpawn<LDLine>(verts[0], verts[1]);
+			obj->setColor(EdgeColor);
 			objs << obj;
 			break;
 		}
@@ -82,18 +82,18 @@
 		case 4:
 		{
 			LDObject* obj = (verts.size() == 3) ?
-				static_cast<LDObject*> (LDSpawn<LDTriangle>()) :
-				static_cast<LDObject*> (LDSpawn<LDQuad>());
+				static_cast<LDObject*>(LDSpawn<LDTriangle>()) :
+				static_cast<LDObject*>(LDSpawn<LDQuad>());
 
-			obj->setColor (MainColor);
+			obj->setColor(MainColor);
 
 			for (int i = 0; i < verts.size(); ++i)
-				obj->setVertex (i, verts[i]);
+				obj->setVertex(i, verts[i]);
 
 			objs << obj;
 			break;
 		}
 	}
 
-	finishDraw (objs);
+	finishDraw(objs);
 }

mercurial