Commit 649a7fa3 authored by Maciej Suminski's avatar Maciej Suminski

Proper handling of toggling outline display of items.

parent 628c069a
...@@ -506,6 +506,7 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent ) ...@@ -506,6 +506,7 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
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 );
m_galCanvas->GetView()->RecacheAllItems( true );
if( IsGalCanvasActive() ) if( IsGalCanvasActive() )
m_galCanvas->Refresh(); m_galCanvas->Refresh();
......
...@@ -166,6 +166,7 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -166,6 +166,7 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
static_cast<KiGfx::PCB_PAINTER*> ( m_galCanvas->GetView()->GetPainter() ); static_cast<KiGfx::PCB_PAINTER*> ( m_galCanvas->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() );
bool recache = false;
#endif /* KICAD_GAL */ #endif /* KICAD_GAL */
switch( id ) switch( id )
...@@ -216,18 +217,26 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -216,18 +217,26 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
case ID_TB_OPTIONS_SHOW_VIAS_SKETCH: case ID_TB_OPTIONS_SHOW_VIAS_SKETCH:
m_DisplayViaFill = DisplayOpt.DisplayViaFill = !state; m_DisplayViaFill = DisplayOpt.DisplayViaFill = !state;
#ifdef KICAD_GAL
recache = true;
if( !IsGalCanvasActive() )
#endif /* KICAD_GAL */
m_canvas->Refresh(); m_canvas->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH: case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH:
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = !state; m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = !state;
#ifdef KICAD_GAL
recache = true;
if( !IsGalCanvasActive() )
#endif /* KICAD_GAL */
m_canvas->Refresh(); m_canvas->Refresh();
break; break;
case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE: case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE:
DisplayOpt.ContrastModeDisplay = state; DisplayOpt.ContrastModeDisplay = state;
#ifdef KICAD_GAL #ifdef KICAD_GAL
// Apply new display options to the GAL canvas // Apply new display options to the GAL canvas (this is faster than recaching)
settings->LoadDisplayOptions( DisplayOpt ); settings->LoadDisplayOptions( DisplayOpt );
m_galCanvas->GetView()->EnableTopLayer( state ); m_galCanvas->GetView()->EnableTopLayer( state );
m_galCanvas->GetView()->UpdateAllLayersColor(); m_galCanvas->GetView()->UpdateAllLayersColor();
...@@ -261,6 +270,13 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -261,6 +270,13 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
} }
#ifdef KICAD_GAL #ifdef KICAD_GAL
if( recache )
{
// Apply new display options to the GAL canvas
settings->LoadDisplayOptions( DisplayOpt );
m_galCanvas->GetView()->RecacheAllItems( true );
}
if( IsGalCanvasActive() ) if( IsGalCanvasActive() )
m_galCanvas->Refresh(); m_galCanvas->Refresh();
#endif /* KICAD_GAL */ #endif /* KICAD_GAL */
......
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