From d0e85129bf462f8196d1ac09dd0b40886d46478f Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Wed, 18 Feb 2026 15:57:01 -0700 Subject: [PATCH] fix: Correct XY and XZ plane geometry and hit-testing Co-authored-by: aider (gemini/gemini-2.5-pro) --- src/ViewportWidget.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ViewportWidget.cpp b/src/ViewportWidget.cpp index 30462cc..b2b2120 100644 --- a/src/ViewportWidget.cpp +++ b/src/ViewportWidget.cpp @@ -702,13 +702,13 @@ void ViewportWidget::drawSelectionPlanes() }; // XY Plane (Top) - QVector xyQuad = { planeOffset, 0, planeOffset, planeOffset + planeSize, 0, planeOffset, - planeOffset + planeSize, 0, planeOffset + planeSize, planeOffset, 0, planeOffset + planeSize }; + 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) - QVector xzQuad = { planeOffset, planeOffset, 0, planeOffset + planeSize, planeOffset, 0, - planeOffset + planeSize, planeOffset + planeSize, 0, planeOffset, planeOffset + planeSize, 0 }; + QVector xzQuad = { planeOffset, 0, planeOffset, planeOffset + planeSize, 0, planeOffset, + planeOffset + planeSize, 0, planeOffset + planeSize, planeOffset, 0, planeOffset + planeSize }; drawPlane(xzQuad, m_highlightedPlane == SketchPlane::XZ); // YZ Plane (Right) @@ -739,14 +739,14 @@ ViewportWidget::SketchPlane ViewportWidget::checkPlaneSelection(const QPoint& sc // XZ plane (Front) intersection = unproject(screenPos, SketchPlane::XZ); if (intersection.x() >= planeOffset && intersection.x() <= planeOffset + planeSize && - intersection.y() >= planeOffset && intersection.y() <= planeOffset + planeSize) { + intersection.z() >= planeOffset && intersection.z() <= planeOffset + planeSize) { return SketchPlane::XZ; } // XY plane (Top) intersection = unproject(screenPos, SketchPlane::XY); if (intersection.x() >= planeOffset && intersection.x() <= planeOffset + planeSize && - intersection.z() >= planeOffset && intersection.z() <= planeOffset + planeSize) { + intersection.y() >= planeOffset && intersection.y() <= planeOffset + planeSize) { return SketchPlane::XY; }