diff --git a/3d-viewer/3d_viewer/3d_menubar.cpp b/3d-viewer/3d_viewer/3d_menubar.cpp index 682726684a..7ec4a40a47 100644 --- a/3d-viewer/3d_viewer/3d_menubar.cpp +++ b/3d-viewer/3d_viewer/3d_menubar.cpp @@ -76,8 +76,8 @@ void EDA_3D_VIEWER_FRAME::CreateMenuBar() // ACTION_MENU* viewMenu = new ACTION_MENU( false, tool ); - viewMenu->Add( ACTIONS::zoomIn ); - viewMenu->Add( ACTIONS::zoomOut ); + viewMenu->Add( ACTIONS::zoomInCenter ); + viewMenu->Add( ACTIONS::zoomOutCenter ); viewMenu->Add( ACTIONS::zoomFitScreen ); viewMenu->Add( ACTIONS::zoomRedraw ); diff --git a/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp b/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp index fc3a44805b..31e822c29e 100644 --- a/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp +++ b/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp @@ -36,8 +36,8 @@ bool EDA_3D_CONTROLLER::Init() { CONDITIONAL_MENU& ctxMenu = m_menu.GetMenu(); - ctxMenu.AddItem( ACTIONS::zoomIn, SELECTION_CONDITIONS::ShowAlways ); - ctxMenu.AddItem( ACTIONS::zoomOut, SELECTION_CONDITIONS::ShowAlways ); + ctxMenu.AddItem( ACTIONS::zoomInCenter, SELECTION_CONDITIONS::ShowAlways ); + ctxMenu.AddItem( ACTIONS::zoomOutCenter, SELECTION_CONDITIONS::ShowAlways ); ctxMenu.AddSeparator(); ctxMenu.AddItem( EDA_3D_ACTIONS::viewTop, SELECTION_CONDITIONS::ShowAlways ); @@ -346,11 +346,14 @@ void EDA_3D_CONTROLLER::setTransitions() // Zoom control Go( &EDA_3D_CONTROLLER::ZoomRedraw, ACTIONS::zoomRedraw.MakeEvent() ); - Go( &EDA_3D_CONTROLLER::ZoomInOut, ACTIONS::zoomIn.MakeEvent() ); - Go( &EDA_3D_CONTROLLER::ZoomInOut, ACTIONS::zoomOut.MakeEvent() ); Go( &EDA_3D_CONTROLLER::ZoomInOutCenter, ACTIONS::zoomInCenter.MakeEvent() ); Go( &EDA_3D_CONTROLLER::ZoomInOutCenter, ACTIONS::zoomOutCenter.MakeEvent() ); Go( &EDA_3D_CONTROLLER::ZoomFitScreen, ACTIONS::zoomFitScreen.MakeEvent() ); + // zoom in/out at cursor does not exist in 3D viewer but because F1 and F2 keys generate + // a zoomIn/zoomOut event, these events must be captured to use these hot keys. The actual + // zoom is the same as ZoomInOutCenter + Go( &EDA_3D_CONTROLLER::ZoomInOut, ACTIONS::zoomIn.MakeEvent() ); + Go( &EDA_3D_CONTROLLER::ZoomInOut, ACTIONS::zoomOut.MakeEvent() ); // Grid Go( &EDA_3D_CONTROLLER::On3DGridSelection, EDA_3D_ACTIONS::noGrid.MakeEvent() );