diff --git a/src/ViewportWidget.cpp b/src/ViewportWidget.cpp index b8fbba5..ccc2b73 100644 --- a/src/ViewportWidget.cpp +++ b/src/ViewportWidget.cpp @@ -146,15 +146,15 @@ void ViewportWidget::paintGL() glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_LINE_LOOP); if (m_currentPlane == SketchPlane::XY) { - glVertex3f(-rectSize, -rectSize, 0); - glVertex3f( rectSize, -rectSize, 0); - glVertex3f( rectSize, rectSize, 0); - glVertex3f(-rectSize, rectSize, 0); - } else if (m_currentPlane == SketchPlane::XZ) { glVertex3f(-rectSize, 0, -rectSize); glVertex3f( rectSize, 0, -rectSize); glVertex3f( rectSize, 0, rectSize); glVertex3f(-rectSize, 0, rectSize); + } else if (m_currentPlane == SketchPlane::XZ) { + glVertex3f(-rectSize, -rectSize, 0); + glVertex3f( rectSize, -rectSize, 0); + glVertex3f( rectSize, rectSize, 0); + glVertex3f(-rectSize, rectSize, 0); } else if (m_currentPlane == SketchPlane::YZ) { glVertex3f(0, -rectSize, -rectSize); glVertex3f(0, rectSize, -rectSize); @@ -170,15 +170,15 @@ void ViewportWidget::paintGL() glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_LINE_LOOP); if (m_currentPlane == SketchPlane::XY) { - glVertex3f(m_snapVertex.X() - rectSize, m_snapVertex.Y() - rectSize, m_snapVertex.Z()); - glVertex3f(m_snapVertex.X() + rectSize, m_snapVertex.Y() - rectSize, m_snapVertex.Z()); - glVertex3f(m_snapVertex.X() + rectSize, m_snapVertex.Y() + rectSize, m_snapVertex.Z()); - glVertex3f(m_snapVertex.X() - rectSize, m_snapVertex.Y() + rectSize, m_snapVertex.Z()); - } else if (m_currentPlane == SketchPlane::XZ) { glVertex3f(m_snapVertex.X() - rectSize, m_snapVertex.Y(), m_snapVertex.Z() - rectSize); glVertex3f(m_snapVertex.X() + rectSize, m_snapVertex.Y(), m_snapVertex.Z() - rectSize); glVertex3f(m_snapVertex.X() + rectSize, m_snapVertex.Y(), m_snapVertex.Z() + rectSize); glVertex3f(m_snapVertex.X() - rectSize, m_snapVertex.Y(), m_snapVertex.Z() + rectSize); + } else if (m_currentPlane == SketchPlane::XZ) { + glVertex3f(m_snapVertex.X() - rectSize, m_snapVertex.Y() - rectSize, m_snapVertex.Z()); + glVertex3f(m_snapVertex.X() + rectSize, m_snapVertex.Y() - rectSize, m_snapVertex.Z()); + glVertex3f(m_snapVertex.X() + rectSize, m_snapVertex.Y() + rectSize, m_snapVertex.Z()); + glVertex3f(m_snapVertex.X() - rectSize, m_snapVertex.Y() + rectSize, m_snapVertex.Z()); } else if (m_currentPlane == SketchPlane::YZ) { glVertex3f(m_snapVertex.X(), m_snapVertex.Y() - rectSize, m_snapVertex.Z() - rectSize); glVertex3f(m_snapVertex.X(), m_snapVertex.Y() + rectSize, m_snapVertex.Z() - rectSize);