diff --git a/gerbview/clear_gbr_drawlayers.cpp b/gerbview/clear_gbr_drawlayers.cpp index 96cdae1ddd..1bd6b63138 100644 --- a/gerbview/clear_gbr_drawlayers.cpp +++ b/gerbview/clear_gbr_drawlayers.cpp @@ -55,6 +55,9 @@ bool GERBVIEW_FRAME::Clear_DrawLayers( bool query ) m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); canvas->GetView()->Clear(); + + // Reinit the worksheet view, cleared by GetView()->Clear(): + SetPageSettings( GetPageSettings() ); } GetImagesList()->DeleteAllImages(); diff --git a/gerbview/gerbview_draw_panel_gal.cpp b/gerbview/gerbview_draw_panel_gal.cpp index 547e8b9a9d..19e83a935e 100644 --- a/gerbview/gerbview_draw_panel_gal.cpp +++ b/gerbview/gerbview_draw_panel_gal.cpp @@ -168,3 +168,12 @@ void GERBVIEW_DRAW_PANEL_GAL::SetTopLayer( int aLayer ) m_view->UpdateAllLayersOrder(); } + + +BOX2I GERBVIEW_DRAW_PANEL_GAL::GetDefaultViewBBox() const +{ + if( m_worksheet ) + return m_worksheet->ViewBBox(); + + return BOX2I(); +} diff --git a/gerbview/gerbview_draw_panel_gal.h b/gerbview/gerbview_draw_panel_gal.h index 4e9ea44bd6..5b05a65afb 100644 --- a/gerbview/gerbview_draw_panel_gal.h +++ b/gerbview/gerbview_draw_panel_gal.h @@ -61,6 +61,9 @@ public: ///> @copydoc EDA_DRAW_PANEL_GAL::SetTopLayer virtual void SetTopLayer( int aLayer ) override; + ///> @copydoc EDA_DRAW_PANEL_GAL::GetDefaultViewBBox() + BOX2I GetDefaultViewBBox() const override; + /** * Sets (or updates) worksheet used by the draw panel. * @param aWorksheet is the worksheet to be used. diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 813d7fda65..9a2b778474 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -75,6 +75,10 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ): // obviously depends on the monitor, // but this is an acceptable value + // Be sure a page info is set. this default value will be overwritten later. + PAGE_INFO pageInfo( wxT( "GERBER" ) ); + SetPageSettings( pageInfo ); + m_show_layer_manager_tools = true; m_showAxis = true; // true to show X and Y axis on screen