From f53dafd496bbc6beac9466990273ba5e23a0dd00 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 17 Sep 2013 11:21:42 +0200 Subject: [PATCH] Modules are marked to be on copper layer too. --- pcbnew/class_module.cpp | 3 ++- pcbnew/pcb_painter.cpp | 11 +++++++---- pcbnew/pcb_painter.h | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 0b68f61e64..680be27848 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -1027,6 +1027,7 @@ void MODULE::SetOrientation( double newangle ) void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const { - aCount = 1; + aCount = 2; aLayers[0] = ITEM_GAL_LAYER( SELECTION ); // Selection box + aLayers[1] = m_Layer; } diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index b85e0874e6..ea89ecd81d 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -229,7 +229,7 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer ) break; case PCB_MODULE_T: - draw( (MODULE*) aItem ); + draw( (MODULE*) aItem, aLayer ); break; case PCB_TEXT_T: @@ -700,11 +700,14 @@ void PCB_PAINTER::draw( const DRAWSEGMENT* aSegment ) } -void PCB_PAINTER::draw( const MODULE* aModule ) +void PCB_PAINTER::draw( const MODULE* aModule, int aLayer ) { // For modules we have to draw a selection box if needed - if( aModule->IsSelected() ) - drawSelectionBox( aModule ); + if( aLayer == ITEM_GAL_LAYER( SELECTION ) ) + { + if( aModule->IsSelected() ) + drawSelectionBox( aModule ); + } } diff --git a/pcbnew/pcb_painter.h b/pcbnew/pcb_painter.h index 2e106f2b93..6899c54979 100644 --- a/pcbnew/pcb_painter.h +++ b/pcbnew/pcb_painter.h @@ -145,7 +145,7 @@ protected: void draw( const SEGVIA*, int ); void draw( const D_PAD*, int ); void draw( const DRAWSEGMENT* ); - void draw( const MODULE* ); + void draw( const MODULE*, int ); void draw( const TEXTE_PCB*, int ); void draw( const TEXTE_MODULE*, int ); void draw( const ZONE_CONTAINER* );