From 4f08770fa288af905f6772c1ee665049ac3cf3c1 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 15 Feb 2026 10:25:48 -0700 Subject: [PATCH] feat: Show XY (Top) grid by default and when sketch ends Co-authored-by: aider (gemini/gemini-2.5-pro) --- src/ViewportWidget.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ViewportWidget.cpp b/src/ViewportWidget.cpp index ccc2b73..8e457f4 100644 --- a/src/ViewportWidget.cpp +++ b/src/ViewportWidget.cpp @@ -31,6 +31,14 @@ ViewportWidget::ViewportWidget(QWidget *parent) setMouseTracking(true); setFocusPolicy(Qt::StrongFocus); + // Set initial view to Top (XY plane) and show grid + m_xRot = 90 * 16; + m_yRot = 0; + m_zoom = -20.0f; + m_panX = 0.0f; + m_panY = 0.0f; + m_currentPlane = SketchPlane::XY; + m_toolIcons.insert(static_cast(ApplicationController::ToolType::Line), new QSvgRenderer(QString(":/icons/line.svg"), this)); m_toolIcons.insert(static_cast(ApplicationController::ToolType::Rectangle), new QSvgRenderer(QString(":/icons/rectangle.svg"), this)); m_toolIcons.insert(static_cast(ApplicationController::ToolType::Circle), new QSvgRenderer(QString(":/icons/circle.svg"), this)); @@ -572,7 +580,8 @@ void ViewportWidget::onSketchModeEnded() animGroup->addAnimation(zoomAnim); connect(animGroup, &QParallelAnimationGroup::finished, this, [this]() { - m_currentPlane = SketchPlane::NONE; + // Return to showing the base XY grid when not in a sketch + m_currentPlane = SketchPlane::XY; update(); });