Commit a5972e7b authored by Maciej Suminski's avatar Maciej Suminski

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

parent caafffd7
...@@ -433,10 +433,13 @@ void PCB_BASE_FRAME::OnTogglePolarCoords( wxCommandEvent& aEvent ) ...@@ -433,10 +433,13 @@ 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();
if( gal )
{
// Apply new display options to the GAL canvas // Apply new display options to the GAL canvas
KIGFX::PCB_PAINTER* painter = KIGFX::PCB_PAINTER* painter =
static_cast<KIGFX::PCB_PAINTER*> ( GetGalCanvas()->GetView()->GetPainter() ); static_cast<KIGFX::PCB_PAINTER*> ( gal->GetView()->GetPainter() );
KIGFX::PCB_RENDER_SETTINGS* settings = KIGFX::PCB_RENDER_SETTINGS* settings =
static_cast<KIGFX::PCB_RENDER_SETTINGS*> ( painter->GetSettings() ); static_cast<KIGFX::PCB_RENDER_SETTINGS*> ( painter->GetSettings() );
settings->LoadDisplayOptions( DisplayOpt ); settings->LoadDisplayOptions( DisplayOpt );
...@@ -448,6 +451,7 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent ) ...@@ -448,6 +451,7 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() ) for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
pad->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); 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