From ee0fe85cd0a16ef0dcce3907d5071d3f5f07cb6b Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 4 Apr 2013 14:17:40 +0200 Subject: [PATCH] Added setting active layer in PAINTER's render settings according to the PCB layer widget. --- pcbnew/class_pcb_layer_widget.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pcbnew/class_pcb_layer_widget.cpp b/pcbnew/class_pcb_layer_widget.cpp index 731d6051f4..8d5613e0b0 100644 --- a/pcbnew/class_pcb_layer_widget.cpp +++ b/pcbnew/class_pcb_layer_widget.cpp @@ -34,6 +34,7 @@ #ifdef KICAD_GAL #include #include +#include #endif #include #include @@ -342,8 +343,19 @@ bool PCB_LAYER_WIDGET::OnLayerSelect( int aLayer ) // false from this function. myframe->setActiveLayer( aLayer, false ); +#ifdef KICAD_GAL + myframe->GetGalCanvas()->GetView()->GetPainter()->GetSettings()->SetActiveLayer( aLayer ); +#endif /* KICAD_GAL */ + if(DisplayOpt.ContrastModeDisplay) - myframe->GetCanvas()->Refresh(); + { +#ifdef KICAD_GAL + if( myframe->IsGalCanvasActive() ) + myframe->GetGalCanvas()->Refresh(); + else +#endif + myframe->GetCanvas()->Refresh(); + } return true; }