Make sure grid settings get set in new canvas when switching.
This commit is contained in:
parent
b578f8b362
commit
69e60d3982
|
@ -265,11 +265,12 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
||||||
m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||||
|
|
||||||
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
|
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||||
|
GetGalCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||||
GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||||
ActivateGalCanvas();
|
ActivateGalCanvas();
|
||||||
|
|
||||||
m_auimgr.Update();
|
m_auimgr.Update();
|
||||||
|
GetToolManager()->RunAction( ACTIONS::gridPreset, true, m_LastGridSizeId );
|
||||||
GetToolManager()->RunAction( ACTIONS::zoomFitScreen );
|
GetToolManager()->RunAction( ACTIONS::zoomFitScreen );
|
||||||
updateTitle();
|
updateTitle();
|
||||||
|
|
||||||
|
@ -292,7 +293,9 @@ void FOOTPRINT_EDIT_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasTyp
|
||||||
{
|
{
|
||||||
// switches currently used canvas (Cairo / OpenGL).
|
// switches currently used canvas (Cairo / OpenGL).
|
||||||
PCB_BASE_FRAME::SwitchCanvas( aCanvasType );
|
PCB_BASE_FRAME::SwitchCanvas( aCanvasType );
|
||||||
|
|
||||||
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
|
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||||
|
GetGalCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||||
|
|
||||||
// The base class method *does not reinit* the layers manager. We must upate the layer
|
// The base class method *does not reinit* the layers manager. We must upate the layer
|
||||||
// widget to match board visibility states, both layers and render columns, and and some
|
// widget to match board visibility states, both layers and render columns, and and some
|
||||||
|
|
|
@ -342,6 +342,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
syncLayerWidgetLayer();
|
syncLayerWidgetLayer();
|
||||||
|
|
||||||
m_auimgr.Update();
|
m_auimgr.Update();
|
||||||
|
GetToolManager()->RunAction( ACTIONS::gridPreset, true, m_LastGridSizeId );
|
||||||
GetToolManager()->RunAction( ACTIONS::zoomFitScreen );
|
GetToolManager()->RunAction( ACTIONS::zoomFitScreen );
|
||||||
|
|
||||||
m_canvasType = LoadCanvasTypeSetting();
|
m_canvasType = LoadCanvasTypeSetting();
|
||||||
|
@ -388,7 +389,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
}
|
}
|
||||||
|
|
||||||
GetGalCanvas()->SwitchBackend( m_canvasType );
|
GetGalCanvas()->SwitchBackend( m_canvasType );
|
||||||
|
galCanvas->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||||
galCanvas->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
galCanvas->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||||
ActivateGalCanvas();
|
ActivateGalCanvas();
|
||||||
|
|
||||||
|
@ -977,6 +978,8 @@ void PCB_EDIT_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType )
|
||||||
// switches currently used canvas (Cairo / OpenGL).
|
// switches currently used canvas (Cairo / OpenGL).
|
||||||
PCB_BASE_FRAME::SwitchCanvas( aCanvasType );
|
PCB_BASE_FRAME::SwitchCanvas( aCanvasType );
|
||||||
|
|
||||||
|
GetGalCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||||
|
|
||||||
// The base class method *does not reinit* the layers manager. We must upate the
|
// The base class method *does not reinit* the layers manager. We must upate the
|
||||||
// layer widget to match board visibility states, both layers and render columns.
|
// layer widget to match board visibility states, both layers and render columns.
|
||||||
syncLayerVisibilities();
|
syncLayerVisibilities();
|
||||||
|
|
Loading…
Reference in New Issue