Skip to content

Commit

Permalink
#10136 Reset zoom by double-click in 3D view
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Jan 25, 2024
1 parent 10a579f commit af43e47
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ApplicationLibCode/UserInterface/RiuViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,21 @@ void RiuViewer::mousePressEvent( QMouseEvent* event )
m_lastMousePressPosition = event->pos();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::mouseDoubleClickEvent( QMouseEvent* event )
{
if ( auto view = dynamic_cast<Rim3dView*>( m_rimView.p() ) )
{
view->zoomAll();

return;
}

caf::Viewer::mouseDoubleClickEvent( event );
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions ApplicationLibCode/UserInterface/RiuViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public slots:

void mouseReleaseEvent( QMouseEvent* event ) override;
void mousePressEvent( QMouseEvent* event ) override;
void mouseDoubleClickEvent( QMouseEvent* event ) override;

private:
QLabel* m_infoLabel;
Expand Down

0 comments on commit af43e47

Please sign in to comment.