mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
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 );
|
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||||
|
|
||||||
canvas->GetView()->Clear();
|
canvas->GetView()->Clear();
|
||||||
|
|
||||||
|
// Reinit the worksheet view, cleared by GetView()->Clear():
|
||||||
|
SetPageSettings( GetPageSettings() );
|
||||||
}
|
}
|
||||||
|
|
||||||
GetImagesList()->DeleteAllImages();
|
GetImagesList()->DeleteAllImages();
|
||||||
|
@ -168,3 +168,12 @@ void GERBVIEW_DRAW_PANEL_GAL::SetTopLayer( int aLayer )
|
|||||||
|
|
||||||
m_view->UpdateAllLayersOrder();
|
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
|
///> @copydoc EDA_DRAW_PANEL_GAL::SetTopLayer
|
||||||
virtual void SetTopLayer( int aLayer ) override;
|
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.
|
* Sets (or updates) worksheet used by the draw panel.
|
||||||
* @param aWorksheet is the worksheet to be used.
|
* @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,
|
// obviously depends on the monitor,
|
||||||
// but this is an acceptable value
|
// 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_show_layer_manager_tools = true;
|
||||||
|
|
||||||
m_showAxis = true; // true to show X and Y axis on screen
|
m_showAxis = true; // true to show X and Y axis on screen
|
||||||
|
Loading…
x
Reference in New Issue
Block a user