diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index ea45cde11b..07e0373981 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -360,6 +360,15 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( EE_ACTIONS::properties ); } + // Middle double click? Do zoom to fit or zoom to objects + else if( evt->IsDblClick( BUT_MIDDLE ) ) + { + if( m_exclusive_or ) // Is CTRL key down? + m_toolMgr->RunAction( ACTIONS::zoomFitObjects, true ); + else + m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true ); + } + // drag with LMB? Select multiple objects (or at least draw a selection box) or drag them else if( evt->IsDrag( BUT_LEFT ) ) { diff --git a/gerbview/tools/gerbview_selection_tool.cpp b/gerbview/tools/gerbview_selection_tool.cpp index 8920115c40..0e486e7b7a 100644 --- a/gerbview/tools/gerbview_selection_tool.cpp +++ b/gerbview/tools/gerbview_selection_tool.cpp @@ -214,6 +214,12 @@ int GERBVIEW_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) m_menu.ShowContextMenu( m_selection ); } + // Middle double click? Do zoom to fit + else if( evt->IsDblClick( BUT_MIDDLE ) ) + { + m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true ); + } + else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO_PRE ) { clearSelection(); diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index ed306f85f2..438ecbc301 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -274,6 +274,12 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) } } + // Middle double click? Do zoom to fit + else if( evt->IsDblClick( BUT_MIDDLE ) ) + { + m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true ); + } + // drag with LMB? Select multiple objects (or at least draw a selection box) or drag them else if( evt->IsDrag( BUT_LEFT ) ) {