feat: Add animated home button to view cube to reset camera

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-17 16:56:25 -07:00
parent 405e151f12
commit c28c080009
5 changed files with 122 additions and 4 deletions

View File

@@ -202,6 +202,7 @@ void ViewportWidget::paintGL()
m_sketchGrid->paintAxisLabels(painter, static_cast<SketchGrid::SketchPlane>(m_currentPlane), model, projection);
}
m_featureBrowser->paint(painter, width(), height());
m_viewCube->paint2D(painter, width(), height());
if (m_activeSketchTool) {
@@ -230,6 +231,12 @@ void ViewportWidget::mousePressEvent(QMouseEvent *event)
}
if (event->button() == Qt::LeftButton) {
if (m_viewCube->handleMousePress(event->pos(), width(), height())) {
m_camera->animateToHomeView();
update();
return;
}
if (m_isSelectingPlane) {
if (m_highlightedPlane != SketchPlane::NONE) {
emit planeSelected(m_highlightedPlane);