← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Move ZoomFitScreen and ZoomPreset to common

 

Hi Orson,

Here's an updated patch with the changes you requested.  The only issue is,
without some kind of caching, I had to change the call sites that were
interested in the board bounding box with edges only, so the patch has
grown in scope.  Let me know if this looks better.

Best,
Jon

On Thu, Feb 23, 2017 at 4:17 AM, Maciej Sumiński <maciej.suminski@xxxxxxx>
wrote:

> Hi Jon,
>
> I really like the generic approach in the zoom methods. This part I
> would merge instantly, but there is an issue with caching the board
> bounding box. It does not take into account that items already added to
> board may change their position and affect the bounding box. I would
> remove caching completely, what do you think?
>
> If you are going to modify the patch, would you rename boardBBox in
> COMMON_TOOLS::ZoomFitScreen() to bbox or anything that is not related to
> board? Thank you in advance.
>
> Regards,
> Orson
>
> On 02/23/2017 05:34 AM, Jon Evans wrote:
> > Hi all,
> >
> > This patch finishes off the refactor I did a few days ago, by enabling
> > ZoomFitScreen to work without knowledge of the BOARD class.
> >
> > In order to make this work, I changed the way GetBoundingBox and
> > ComputeBoundingBox work so that the call sites of GetBoundingBox don't
> have
> > to also call ComputeBoundingBox if they don't need to use the
> > aBoardEdgesOnly flag.
> >
> > Those with good knowledge of BOARD should review this to make sure I
> caught
> > all the instances where we should mark the bounding box as needing to be
> > re-computed.
> >
> > Best,
> > Jon
> >
> >
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> >
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
>
From 5ea384e2975e0fe7df0817a189522486c8a411ee Mon Sep 17 00:00:00 2001
From: Jon Evans <jon@xxxxxxxxxxxxx>
Date: Wed, 22 Feb 2017 23:31:26 -0500
Subject: [PATCH] Move ZoomFitScreen and ZoomPreset from PCBNEW_CONTROL to
 COMMON_TOOLS

BOARD::GetBoundingBox() now directly calls BOARD::ComputeBoundingBox()
and there is a new method BOARD::GetBoardEdgesBoundingBox() used for
call sites that needed to use ComputeBoundingBox( true ) in the past.

This allows COMMON_TOOLS to implement ZoomFitScreen without knowledge
of the BOARD class.
---
 common/tool/common_tools.cpp                | 65 +++++++++++++++++++++++++++
 include/tool/common_tools.h                 |  2 +
 pcbnew/autorouter/auto_place_footprints.cpp |  2 +-
 pcbnew/autorouter/routing_matrix.cpp        |  4 +-
 pcbnew/autorouter/spread_footprints.cpp     |  2 +-
 pcbnew/basepcbframe.cpp                     |  2 +-
 pcbnew/board_netlist_updater.cpp            |  2 +-
 pcbnew/class_board.cpp                      |  5 ++-
 pcbnew/class_board.h                        | 14 ++++--
 pcbnew/dialogs/dialog_export_idf.cpp        |  2 +-
 pcbnew/dialogs/dialog_update_pcb.cpp        |  2 +-
 pcbnew/eagle_plugin.cpp                     |  2 +-
 pcbnew/exporters/export_idf.cpp             |  2 +-
 pcbnew/exporters/gen_drill_report_files.cpp |  2 +-
 pcbnew/netlist.cpp                          |  2 +-
 pcbnew/specctra_export.cpp                  |  2 +-
 pcbnew/tools/pcbnew_control.cpp             | 68 -----------------------------
 pcbnew/tools/pcbnew_control.h               |  4 --
 18 files changed, 93 insertions(+), 91 deletions(-)

diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp
index b5b7b07..37e46d1 100644
--- a/common/tool/common_tools.cpp
+++ b/common/tool/common_tools.cpp
@@ -98,6 +98,69 @@ int COMMON_TOOLS::ZoomCenter( const TOOL_EVENT& aEvent )
 }
 
 
+int COMMON_TOOLS::ZoomFitScreen( const TOOL_EVENT& aEvent )
+{
+    KIGFX::VIEW* view = getView();
+    EDA_DRAW_PANEL_GAL* galCanvas = m_frame->GetGalCanvas();
+    EDA_ITEM* model = getModel<EDA_ITEM>();
+
+    BOX2I bBox = model->ViewBBox();
+    VECTOR2D scrollbarSize = VECTOR2D( galCanvas->GetSize() - galCanvas->GetClientSize() );
+    VECTOR2D screenSize = view->ToWorld( galCanvas->GetClientSize(), false );
+
+    if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
+    {
+        // Empty view
+        view->SetScale( 17.0 );     // works fine for the standard worksheet frame
+
+        view->SetCenter( screenSize / 2.0 );
+    }
+    else
+    {
+        VECTOR2D vsize = bBox.GetSize();
+        double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
+                                                    fabs( vsize.y / screenSize.y ) );
+
+        view->SetScale( scale );
+        view->SetCenter( bBox.Centre() );
+    }
+
+
+    // Take scrollbars into account
+    VECTOR2D worldScrollbarSize = view->ToWorld( scrollbarSize, false );
+    view->SetCenter( view->GetCenter() + worldScrollbarSize / 2.0 );
+
+    return 0;
+}
+
+
+int COMMON_TOOLS::ZoomPreset( const TOOL_EVENT& aEvent )
+{
+    unsigned int idx = aEvent.Parameter<intptr_t>();
+    std::vector<double>& zoomList = m_frame->GetScreen()->m_ZoomList;
+    KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
+    KIGFX::GAL* gal = m_frame->GetGalCanvas()->GetGAL();
+
+    m_frame->SetPresetZoom( idx );
+
+    if( idx == 0 )      // Zoom Auto
+    {
+        return ZoomFitScreen( aEvent );
+    }
+    else if( idx >= zoomList.size() )
+    {
+        assert( false );
+        return 0;
+    }
+
+    double selectedZoom = zoomList[idx];
+    double zoomFactor = gal->GetWorldScale() / gal->GetZoomFactor();
+    view->SetScale( 1.0 / ( zoomFactor * selectedZoom ) );
+
+    return 0;
+}
+
+
 // Grid control
 int COMMON_TOOLS::GridNext( const TOOL_EVENT& aEvent )
 {
@@ -135,6 +198,8 @@ void COMMON_TOOLS::SetTransitions()
     Go( &COMMON_TOOLS::ZoomInOutCenter,    ACTIONS::zoomInCenter.MakeEvent() );
     Go( &COMMON_TOOLS::ZoomInOutCenter,    ACTIONS::zoomOutCenter.MakeEvent() );
     Go( &COMMON_TOOLS::ZoomCenter,         ACTIONS::zoomCenter.MakeEvent() );
+    Go( &COMMON_TOOLS::ZoomFitScreen,      ACTIONS::zoomFitScreen.MakeEvent() );
+    Go( &COMMON_TOOLS::ZoomPreset,         ACTIONS::zoomPreset.MakeEvent() );
 
     Go( &COMMON_TOOLS::GridNext,           ACTIONS::gridNext.MakeEvent() );
     Go( &COMMON_TOOLS::GridPrev,           ACTIONS::gridPrev.MakeEvent() );
diff --git a/include/tool/common_tools.h b/include/tool/common_tools.h
index c37d0cd..9f60402 100644
--- a/include/tool/common_tools.h
+++ b/include/tool/common_tools.h
@@ -48,6 +48,8 @@ public:
     int ZoomInOut( const TOOL_EVENT& aEvent );
     int ZoomInOutCenter( const TOOL_EVENT& aEvent );
     int ZoomCenter( const TOOL_EVENT& aEvent );
+    int ZoomFitScreen( const TOOL_EVENT& aEvent );
+    int ZoomPreset( const TOOL_EVENT& aEvent );
 
     // Grid control
     int GridNext( const TOOL_EVENT& aEvent );
diff --git a/pcbnew/autorouter/auto_place_footprints.cpp b/pcbnew/autorouter/auto_place_footprints.cpp
index 2de743e..ddb75be 100644
--- a/pcbnew/autorouter/auto_place_footprints.cpp
+++ b/pcbnew/autorouter/auto_place_footprints.cpp
@@ -459,7 +459,7 @@ int genPlacementRoutingMatrix( BOARD* aBrd, EDA_MSG_PANEL* messagePanel )
 
     RoutingMatrix.UnInitRoutingMatrix();
 
-    EDA_RECT bbox = aBrd->ComputeBoundingBox( true );
+    EDA_RECT bbox = aBrd->GetBoardEdgesBoundingBox();
 
     if( bbox.GetWidth() == 0 || bbox.GetHeight() == 0 )
     {
diff --git a/pcbnew/autorouter/routing_matrix.cpp b/pcbnew/autorouter/routing_matrix.cpp
index f3daa2e..9416364 100644
--- a/pcbnew/autorouter/routing_matrix.cpp
+++ b/pcbnew/autorouter/routing_matrix.cpp
@@ -69,10 +69,8 @@ MATRIX_ROUTING_HEAD::~MATRIX_ROUTING_HEAD()
 
 bool MATRIX_ROUTING_HEAD::ComputeMatrixSize( BOARD* aPcb, bool aUseBoardEdgesOnly )
 {
-    aPcb->ComputeBoundingBox( aUseBoardEdgesOnly );
-
     // The boundary box must have its start point on routing grid:
-    m_BrdBox = aPcb->GetBoundingBox();
+    m_BrdBox = aUseBoardEdgesOnly ? aPcb->GetBoardEdgesBoundingBox() : aPcb->GetBoundingBox();
 
     m_BrdBox.SetX( m_BrdBox.GetX() - ( m_BrdBox.GetX() % m_GridRouting ) );
     m_BrdBox.SetY( m_BrdBox.GetY() - ( m_BrdBox.GetY() % m_GridRouting ) );
diff --git a/pcbnew/autorouter/spread_footprints.cpp b/pcbnew/autorouter/spread_footprints.cpp
index 2502ae4..d23d5ea 100644
--- a/pcbnew/autorouter/spread_footprints.cpp
+++ b/pcbnew/autorouter/spread_footprints.cpp
@@ -177,7 +177,7 @@ void PCB_EDIT_FRAME::SpreadFootprints( std::vector<MODULE*>* aFootprints,
                                        wxPoint aSpreadAreaPosition,
                                        bool aPrepareUndoCommand )
 {
-    EDA_RECT bbox = GetBoard()->ComputeBoundingBox( true );
+    EDA_RECT bbox = GetBoard()->GetBoardEdgesBoundingBox();
     bool     edgesExist = bbox.GetWidth() || bbox.GetHeight();
     // if aFootprintsOutsideBoardOnly is true, and if board outline exists,
     // we have to filter footprints to move:
diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp
index 0636e6b..d192bb2 100644
--- a/pcbnew/basepcbframe.cpp
+++ b/pcbnew/basepcbframe.cpp
@@ -294,7 +294,7 @@ EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox( bool aBoardEdgesOnly ) const
 {
     wxASSERT( m_Pcb );
 
-    EDA_RECT area = m_Pcb->ComputeBoundingBox( aBoardEdgesOnly );
+    EDA_RECT area = aBoardEdgesOnly ? m_Pcb->GetBoardEdgesBoundingBox() : m_Pcb->GetBoundingBox();
 
     if( area.GetWidth() == 0 && area.GetHeight() == 0 )
     {
diff --git a/pcbnew/board_netlist_updater.cpp b/pcbnew/board_netlist_updater.cpp
index 0d32d02..d531b05 100644
--- a/pcbnew/board_netlist_updater.cpp
+++ b/pcbnew/board_netlist_updater.cpp
@@ -79,7 +79,7 @@ wxPoint BOARD_NETLIST_UPDATER::estimateComponentInsertionPosition()
     if( !m_board->IsEmpty() )
     {
         // Position new components below any existing board features.
-        EDA_RECT bbox = m_board->ComputeBoundingBox( true );
+        EDA_RECT bbox = m_board->GetBoardEdgesBoundingBox();
 
         if( bbox.GetWidth() || bbox.GetHeight() )
         {
diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp
index 4d672ab..f8ace58 100644
--- a/pcbnew/class_board.cpp
+++ b/pcbnew/class_board.cpp
@@ -1054,7 +1054,7 @@ unsigned BOARD::GetNodesCount() const
 }
 
 
-EDA_RECT BOARD::ComputeBoundingBox( bool aBoardEdgesOnly )
+EDA_RECT BOARD::ComputeBoundingBox( bool aBoardEdgesOnly ) const
 {
     bool hasItems = false;
     EDA_RECT area;
@@ -2364,6 +2364,7 @@ ZONE_CONTAINER* BOARD::InsertArea( int netcode, int iarea, LAYER_ID layer, int x
         m_ZoneDescriptorList.push_back( new_area );
 
     new_area->Outline()->Start( layer, x, y, hatch );
+
     return new_area;
 }
 
@@ -2425,7 +2426,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
     if( !IsEmpty() )
     {
         // Position new components below any existing board features.
-        EDA_RECT bbbox = ComputeBoundingBox( true );
+        EDA_RECT bbbox = GetBoardEdgesBoundingBox();
 
         if( bbbox.GetWidth() || bbbox.GetHeight() )
         {
diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h
index 1045e6d..e7a910c 100644
--- a/pcbnew/class_board.h
+++ b/pcbnew/class_board.h
@@ -185,7 +185,7 @@ private:
 
     int                     m_fileFormatVersionAtLoad;  ///< the version loaded from the file
 
-    EDA_RECT                m_BoundingBox;
+    mutable EDA_RECT        m_BoundingBox;
     NETINFO_LIST            m_NetInfo;              ///< net info list (name, design constraints ..
     RN_DATA*                m_ratsnest;
 
@@ -825,7 +825,7 @@ public:
      * @return EDA_RECT - the board's bounding box
      * @see PCB_BASE_FRAME::GetBoardBoundingBox() which calls this and doctors the result
      */
-    EDA_RECT ComputeBoundingBox( bool aBoardEdgesOnly = false );
+    EDA_RECT ComputeBoundingBox( bool aBoardEdgesOnly = false ) const;
 
     /**
      * Function GetBoundingBox
@@ -833,7 +833,15 @@ public:
      * as long as the BOARD has not changed.  Remember, ComputeBoundingBox()'s
      * aBoardEdgesOnly argument is considered in this return value also.
      */
-    const EDA_RECT GetBoundingBox() const override { return m_BoundingBox; }
+    const EDA_RECT GetBoundingBox() const override
+    {
+        return ComputeBoundingBox();
+    }
+
+    const EDA_RECT GetBoardEdgesBoundingBox() const
+    {
+        return ComputeBoundingBox( true );
+    }
 
     void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; }
 
diff --git a/pcbnew/dialogs/dialog_export_idf.cpp b/pcbnew/dialogs/dialog_export_idf.cpp
index 80c55ef..4f72767 100644
--- a/pcbnew/dialogs/dialog_export_idf.cpp
+++ b/pcbnew/dialogs/dialog_export_idf.cpp
@@ -183,7 +183,7 @@ void PCB_EDIT_FRAME::OnExportIDF3( wxCommandEvent& event )
 
     if( dlg.GetAutoAdjustOffset() )
     {
-        EDA_RECT bbox = GetBoard()->ComputeBoundingBox( true );
+        EDA_RECT bbox = GetBoard()->GetBoardEdgesBoundingBox();
 
         aXRef = bbox.Centre().x * MM_PER_IU;
         aYRef = bbox.Centre().y * MM_PER_IU;
diff --git a/pcbnew/dialogs/dialog_update_pcb.cpp b/pcbnew/dialogs/dialog_update_pcb.cpp
index b291a0a..ea10825 100644
--- a/pcbnew/dialogs/dialog_update_pcb.cpp
+++ b/pcbnew/dialogs/dialog_update_pcb.cpp
@@ -70,7 +70,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun )
 
     // keep trace of the initial baord area, if we want to place new footprints
     // outside the existinag board
-    EDA_RECT bbox = board->ComputeBoundingBox( false );
+    EDA_RECT bbox = board->GetBoundingBox();
 
     if( !aDryRun )
     {
diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp
index 3913f29..21efba8 100644
--- a/pcbnew/eagle_plugin.cpp
+++ b/pcbnew/eagle_plugin.cpp
@@ -2991,7 +2991,7 @@ void EAGLE_PLUGIN::centerBoard()
         if( m_props->Value( "page_width",  &page_width ) &&
             m_props->Value( "page_height", &page_height ) )
         {
-            EDA_RECT bbbox = m_board->ComputeBoundingBox( true );
+            EDA_RECT bbbox = m_board->GetBoardEdgesBoundingBox();
 
             int w = atoi( page_width.c_str() );
             int h = atoi( page_height.c_str() );
diff --git a/pcbnew/exporters/export_idf.cpp b/pcbnew/exporters/export_idf.cpp
index dffceab..ae8b318 100644
--- a/pcbnew/exporters/export_idf.cpp
+++ b/pcbnew/exporters/export_idf.cpp
@@ -199,7 +199,7 @@ UseBoundingBox:
     // there is always some uncertainty in the board dimensions
     // computed via ComputeBoundingBox() since this depends on the
     // individual module entities.
-    EDA_RECT bbbox = aPcb->ComputeBoundingBox( true );
+    EDA_RECT bbbox = aPcb->GetBoardEdgesBoundingBox();
 
     // convert to mm and compensate for an assumed LINE_WIDTH line thickness
     double  x   = ( bbbox.GetOrigin().x + LINE_WIDTH / 2 ) * scale + offX;
diff --git a/pcbnew/exporters/gen_drill_report_files.cpp b/pcbnew/exporters/gen_drill_report_files.cpp
index ffc9459..06b69c8 100644
--- a/pcbnew/exporters/gen_drill_report_files.cpp
+++ b/pcbnew/exporters/gen_drill_report_files.cpp
@@ -70,7 +70,7 @@ bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName,
     const PAGE_INFO& page_info =  m_pageInfo ? *m_pageInfo : dummy;
 
     // Calculate dimensions and center of PCB
-    EDA_RECT        bbbox = m_pcb->ComputeBoundingBox( true );
+    EDA_RECT        bbbox = m_pcb->GetBoardEdgesBoundingBox();
 
     // Calculate the scale for the format type, scale 1 in HPGL, drawing on
     // an A4 sheet in PS, + text description of symbols
diff --git a/pcbnew/netlist.cpp b/pcbnew/netlist.cpp
index a8108f2..05585db 100644
--- a/pcbnew/netlist.cpp
+++ b/pcbnew/netlist.cpp
@@ -72,7 +72,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
     std::vector<MODULE*> newFootprints;
     // keep trace of the initial baord area, if we want to place new footprints
     // outside the existinag board
-    EDA_RECT bbox = board->ComputeBoundingBox( false );
+    EDA_RECT bbox = board->GetBoundingBox();
 
     netlist.SetIsDryRun( aIsDryRun );
     netlist.SetFindByTimeStamp( aSelectByTimeStamp );
diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp
index eb2c7e5..3e8e99f 100644
--- a/pcbnew/specctra_export.cpp
+++ b/pcbnew/specctra_export.cpp
@@ -1396,7 +1396,7 @@ bool SPECCTRA_DB::GetBoardPolygonOutlines( BOARD* aBoard,
         if( aErrorText )
             *aErrorText = ioe.What();
 
-        EDA_RECT bbbox = aBoard->ComputeBoundingBox( true );
+        EDA_RECT bbbox = aBoard->GetBoardEdgesBoundingBox();
 
         // Ensure non null area. If happen, gives a minimal size.
         if( ( bbbox.GetWidth() ) == 0 || ( bbbox.GetHeight() == 0 ) )
diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp
index fabc005..42e5122 100644
--- a/pcbnew/tools/pcbnew_control.cpp
+++ b/pcbnew/tools/pcbnew_control.cpp
@@ -253,70 +253,6 @@ void PCBNEW_CONTROL::Reset( RESET_REASON aReason )
 }
 
 
-int PCBNEW_CONTROL::ZoomFitScreen( const TOOL_EVENT& aEvent )
-{
-    KIGFX::VIEW* view = getView();
-    EDA_DRAW_PANEL_GAL* galCanvas = m_frame->GetGalCanvas();
-    BOARD* board = getModel<BOARD>();
-    board->ComputeBoundingBox();
-
-    BOX2I boardBBox = board->ViewBBox();
-    VECTOR2D scrollbarSize = VECTOR2D( galCanvas->GetSize() - galCanvas->GetClientSize() );
-    VECTOR2D screenSize = view->ToWorld( galCanvas->GetClientSize(), false );
-
-    if( boardBBox.GetWidth() == 0 || boardBBox.GetHeight() == 0 )
-    {
-        // Empty view
-        view->SetScale( 17.0 );     // works fine for the standard worksheet frame
-
-        view->SetCenter( screenSize / 2.0 );
-    }
-    else
-    {
-        VECTOR2D vsize = boardBBox.GetSize();
-        double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
-                                                    fabs( vsize.y / screenSize.y ) );
-
-        view->SetScale( scale );
-        view->SetCenter( boardBBox.Centre() );
-    }
-
-
-    // Take scrollbars into account
-    VECTOR2D worldScrollbarSize = view->ToWorld( scrollbarSize, false );
-    view->SetCenter( view->GetCenter() + worldScrollbarSize / 2.0 );
-
-    return 0;
-}
-
-
-int PCBNEW_CONTROL::ZoomPreset( const TOOL_EVENT& aEvent )
-{
-    unsigned int idx = aEvent.Parameter<intptr_t>();
-    std::vector<double>& zoomList = m_frame->GetScreen()->m_ZoomList;
-    KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
-    KIGFX::GAL* gal = m_frame->GetGalCanvas()->GetGAL();
-
-    m_frame->SetPresetZoom( idx );
-
-    if( idx == 0 )      // Zoom Auto
-    {
-        return ZoomFitScreen( aEvent );
-    }
-    else if( idx >= zoomList.size() )
-    {
-        assert( false );
-        return 0;
-    }
-
-    double selectedZoom = zoomList[idx];
-    double zoomFactor = gal->GetWorldScale() / gal->GetZoomFactor();
-    view->SetScale( 1.0 / ( zoomFactor * selectedZoom ) );
-
-    return 0;
-}
-
-
 int PCBNEW_CONTROL::TrackDisplayMode( const TOOL_EVENT& aEvent )
 {
     auto painter = static_cast<KIGFX::PCB_PAINTER*>( getView()->GetPainter() );
@@ -1000,10 +936,6 @@ int PCBNEW_CONTROL::ToBeDone( const TOOL_EVENT& aEvent )
 
 void PCBNEW_CONTROL::SetTransitions()
 {
-    // View controls
-    Go( &PCBNEW_CONTROL::ZoomFitScreen,      ACTIONS::zoomFitScreen.MakeEvent() );
-    Go( &PCBNEW_CONTROL::ZoomPreset,         ACTIONS::zoomPreset.MakeEvent() );
-
     // Display modes
     Go( &PCBNEW_CONTROL::TrackDisplayMode,   PCB_ACTIONS::trackDisplayMode.MakeEvent() );
     Go( &PCBNEW_CONTROL::PadDisplayMode,     PCB_ACTIONS::padDisplayMode.MakeEvent() );
diff --git a/pcbnew/tools/pcbnew_control.h b/pcbnew/tools/pcbnew_control.h
index 6ca4ee1..f48db51 100644
--- a/pcbnew/tools/pcbnew_control.h
+++ b/pcbnew/tools/pcbnew_control.h
@@ -47,10 +47,6 @@ public:
     /// @copydoc TOOL_INTERACTIVE::Reset()
     void Reset( RESET_REASON aReason ) override;
 
-    // View controls
-    int ZoomFitScreen( const TOOL_EVENT& aEvent );
-    int ZoomPreset( const TOOL_EVENT& aEvent );
-
     // Display modes
     int TrackDisplayMode( const TOOL_EVENT& aEvent );
     int PadDisplayMode( const TOOL_EVENT& aEvent );
-- 
2.7.4


Follow ups

References