Commit a5972e7b authored by Maciej Suminski's avatar Maciej Suminski

Fixed crash on toggling the pad outline display mode in CvPcb.

parent caafffd7
...@@ -433,20 +433,24 @@ void PCB_BASE_FRAME::OnTogglePolarCoords( wxCommandEvent& aEvent ) ...@@ -433,20 +433,24 @@ void PCB_BASE_FRAME::OnTogglePolarCoords( wxCommandEvent& aEvent )
void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent ) void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
{ {
m_DisplayPadFill = DisplayOpt.DisplayPadFill = !m_DisplayPadFill; m_DisplayPadFill = DisplayOpt.DisplayPadFill = !m_DisplayPadFill;
EDA_DRAW_PANEL_GAL* gal = GetGalCanvas();
// Apply new display options to the GAL canvas if( gal )
KIGFX::PCB_PAINTER* painter =
static_cast<KIGFX::PCB_PAINTER*> ( GetGalCanvas()->GetView()->GetPainter() );
KIGFX::PCB_RENDER_SETTINGS* settings =
static_cast<KIGFX::PCB_RENDER_SETTINGS*> ( painter->GetSettings() );
settings->LoadDisplayOptions( DisplayOpt );
// Update pads
BOARD* board = GetBoard();
for( MODULE* module = board->m_Modules; module; module = module->Next() )
{ {
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() ) // Apply new display options to the GAL canvas
pad->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); KIGFX::PCB_PAINTER* painter =
static_cast<KIGFX::PCB_PAINTER*> ( gal->GetView()->GetPainter() );
KIGFX::PCB_RENDER_SETTINGS* settings =
static_cast<KIGFX::PCB_RENDER_SETTINGS*> ( painter->GetSettings() );
settings->LoadDisplayOptions( DisplayOpt );
// Update pads
BOARD* board = GetBoard();
for( MODULE* module = board->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
pad->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
}
} }
m_canvas->Refresh(); m_canvas->Refresh();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment