fix: Correct XY and XZ plane geometry and hit-testing
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -702,13 +702,13 @@ void ViewportWidget::drawSelectionPlanes()
|
|||||||
};
|
};
|
||||||
|
|
||||||
// XY Plane (Top)
|
// XY Plane (Top)
|
||||||
QVector<GLfloat> xyQuad = { planeOffset, 0, planeOffset, planeOffset + planeSize, 0, planeOffset,
|
QVector<GLfloat> xyQuad = { planeOffset, planeOffset, 0, planeOffset + planeSize, planeOffset, 0,
|
||||||
planeOffset + planeSize, 0, planeOffset + planeSize, planeOffset, 0, planeOffset + planeSize };
|
planeOffset + planeSize, planeOffset + planeSize, 0, planeOffset, planeOffset + planeSize, 0 };
|
||||||
drawPlane(xyQuad, m_highlightedPlane == SketchPlane::XY);
|
drawPlane(xyQuad, m_highlightedPlane == SketchPlane::XY);
|
||||||
|
|
||||||
// XZ Plane (Front)
|
// XZ Plane (Front)
|
||||||
QVector<GLfloat> xzQuad = { planeOffset, planeOffset, 0, planeOffset + planeSize, planeOffset, 0,
|
QVector<GLfloat> xzQuad = { planeOffset, 0, planeOffset, planeOffset + planeSize, 0, planeOffset,
|
||||||
planeOffset + planeSize, planeOffset + planeSize, 0, planeOffset, planeOffset + planeSize, 0 };
|
planeOffset + planeSize, 0, planeOffset + planeSize, planeOffset, 0, planeOffset + planeSize };
|
||||||
drawPlane(xzQuad, m_highlightedPlane == SketchPlane::XZ);
|
drawPlane(xzQuad, m_highlightedPlane == SketchPlane::XZ);
|
||||||
|
|
||||||
// YZ Plane (Right)
|
// YZ Plane (Right)
|
||||||
@@ -739,14 +739,14 @@ ViewportWidget::SketchPlane ViewportWidget::checkPlaneSelection(const QPoint& sc
|
|||||||
// XZ plane (Front)
|
// XZ plane (Front)
|
||||||
intersection = unproject(screenPos, SketchPlane::XZ);
|
intersection = unproject(screenPos, SketchPlane::XZ);
|
||||||
if (intersection.x() >= planeOffset && intersection.x() <= planeOffset + planeSize &&
|
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;
|
return SketchPlane::XZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// XY plane (Top)
|
// XY plane (Top)
|
||||||
intersection = unproject(screenPos, SketchPlane::XY);
|
intersection = unproject(screenPos, SketchPlane::XY);
|
||||||
if (intersection.x() >= planeOffset && intersection.x() <= planeOffset + planeSize &&
|
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;
|
return SketchPlane::XY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user