diff -r 12f9ea615cbc -r 314e12e23c3a src/editmodes/rectangleMode.cpp --- a/src/editmodes/rectangleMode.cpp Thu Jan 04 19:40:52 2018 +0200 +++ b/src/editmodes/rectangleMode.cpp Thu Jan 04 19:44:26 2018 +0200 @@ -22,19 +22,19 @@ #include "../ldObject.h" #include "../glRenderer.h" -RectangleMode::RectangleMode (GLRenderer* renderer) : - Super (renderer), - m_rectangleVerts (QVector(4)) {} +RectangleMode::RectangleMode(GLRenderer* renderer) : + Super(renderer), + m_rectangleVerts(QVector(4)) {} EditModeType RectangleMode::type() const { return EditModeType::Rectangle; } -void RectangleMode::render (QPainter& painter) const +void RectangleMode::render(QPainter& painter) const { - renderPolygon (painter, (m_drawedVerts.size() > 0) ? m_rectangleVerts : - QVector ({renderer()->position3D()}), true, false); + renderPolygon(painter,(m_drawedVerts.size() > 0) ? m_rectangleVerts : + QVector({renderer()->position3D()}), true, false); } void RectangleMode::endDraw() @@ -45,17 +45,17 @@ updateRectVerts(); for (int i = 0; i < quad->numVertices(); ++i) - quad->setVertex (i, m_rectangleVerts[i]); + quad->setVertex(i, m_rectangleVerts[i]); - quad->setColor (MainColor); - finishDraw (LDObjectList ({quad})); + quad->setColor(MainColor); + finishDraw(LDObjectList({quad})); } } // // Update rect vertices when the mouse moves since the 3d position likely has changed // -bool RectangleMode::mouseMoved (QMouseEvent*) +bool RectangleMode::mouseMoved(QMouseEvent*) { updateRectVerts(); return false; @@ -74,19 +74,19 @@ Vertex v0 = m_drawedVerts[0], v1 = (m_drawedVerts.size() >= 2) ? m_drawedVerts[1] : renderer()->position3D(); - const Axis localx = renderer()->getCameraAxis (false), - localy = renderer()->getCameraAxis (true), - localz = (Axis) (3 - localx - localy); + const Axis localx = renderer()->getCameraAxis(false), + localy = renderer()->getCameraAxis(true), + localz = (Axis)(3 - localx - localy); for (int i = 0; i < 4; ++i) - m_rectangleVerts[i].setCoordinate (localz, renderer()->getDepthValue()); + m_rectangleVerts[i].setCoordinate(localz, renderer()->getDepthValue()); - m_rectangleVerts[0].setCoordinate (localx, v0[localx]); - m_rectangleVerts[0].setCoordinate (localy, v0[localy]); - m_rectangleVerts[1].setCoordinate (localx, v1[localx]); - m_rectangleVerts[1].setCoordinate (localy, v0[localy]); - m_rectangleVerts[2].setCoordinate (localx, v1[localx]); - m_rectangleVerts[2].setCoordinate (localy, v1[localy]); - m_rectangleVerts[3].setCoordinate (localx, v0[localx]); - m_rectangleVerts[3].setCoordinate (localy, v1[localy]); + m_rectangleVerts[0].setCoordinate(localx, v0[localx]); + m_rectangleVerts[0].setCoordinate(localy, v0[localy]); + m_rectangleVerts[1].setCoordinate(localx, v1[localx]); + m_rectangleVerts[1].setCoordinate(localy, v0[localy]); + m_rectangleVerts[2].setCoordinate(localx, v1[localx]); + m_rectangleVerts[2].setCoordinate(localy, v1[localy]); + m_rectangleVerts[3].setCoordinate(localx, v0[localx]); + m_rectangleVerts[3].setCoordinate(localy, v1[localy]); }