diff --git a/src/ViewportWidget.cpp b/src/ViewportWidget.cpp index b2b2120..60dcdc7 100644 --- a/src/ViewportWidget.cpp +++ b/src/ViewportWidget.cpp @@ -702,8 +702,8 @@ void ViewportWidget::drawSelectionPlanes() }; // XY Plane (Top) - QVector xyQuad = { planeOffset, planeOffset, 0, planeOffset + planeSize, planeOffset, 0, - planeOffset + planeSize, planeOffset + planeSize, 0, planeOffset, planeOffset + planeSize, 0 }; + QVector xyQuad = { planeOffset, -planeOffset, 0, planeOffset + planeSize, -planeOffset, 0, + planeOffset + planeSize, -planeOffset - planeSize, 0, planeOffset, -planeOffset - planeSize, 0 }; drawPlane(xyQuad, m_highlightedPlane == SketchPlane::XY); // XZ Plane (Front) @@ -712,8 +712,8 @@ void ViewportWidget::drawSelectionPlanes() drawPlane(xzQuad, m_highlightedPlane == SketchPlane::XZ); // YZ Plane (Right) - QVector yzQuad = { 0, planeOffset, planeOffset, 0, planeOffset + planeSize, planeOffset, - 0, planeOffset + planeSize, planeOffset + planeSize, 0, planeOffset, planeOffset + planeSize }; + QVector yzQuad = { 0, -planeOffset, planeOffset, 0, -planeOffset, planeOffset + planeSize, + 0, -planeOffset - planeSize, planeOffset + planeSize, 0, -planeOffset - planeSize, planeOffset }; drawPlane(yzQuad, m_highlightedPlane == SketchPlane::YZ); glEnable(GL_CULL_FACE); @@ -731,7 +731,7 @@ ViewportWidget::SketchPlane ViewportWidget::checkPlaneSelection(const QPoint& sc // Check front to back to handle overlaps // YZ plane (Right) intersection = unproject(screenPos, SketchPlane::YZ); - if (intersection.y() >= planeOffset && intersection.y() <= planeOffset + planeSize && + if (intersection.y() >= -planeOffset - planeSize && intersection.y() <= -planeOffset && intersection.z() >= planeOffset && intersection.z() <= planeOffset + planeSize) { return SketchPlane::YZ; } @@ -746,7 +746,7 @@ ViewportWidget::SketchPlane ViewportWidget::checkPlaneSelection(const QPoint& sc // XY plane (Top) intersection = unproject(screenPos, SketchPlane::XY); if (intersection.x() >= planeOffset && intersection.x() <= planeOffset + planeSize && - intersection.y() >= planeOffset && intersection.y() <= planeOffset + planeSize) { + intersection.y() >= -planeOffset - planeSize && intersection.y() <= -planeOffset) { return SketchPlane::XY; }