Gerbview, GAL mode: fix "Zoom to fit" area size calculation when nothing is loaded.
Also ensure the worksheet is displayed after clearing the gerber layers.
This commit is contained in:
parent
9a228d8ec9
commit
bfa89039c4
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue