From 26f6e259e6eaa814beebe8ae8bc59cdfd1abd37c Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 21 Jun 2013 12:02:17 +0200 Subject: [PATCH] Shows single layer pads with proper colors. --- pcbnew/class_pad.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 3e10dc4c48..caf911f43f 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -764,8 +764,27 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const } else { - // Multi layer pad with hole - pad is shown on one common layer, hole on the other - aLayers[0] = ITEM_GAL_LAYER( PADS_VISIBLE ); + if( IsOnLayer( LAYER_N_FRONT ) && IsOnLayer( LAYER_N_BACK ) ) + { + // Multi layer pad + aLayers[0] = ITEM_GAL_LAYER( PADS_VISIBLE ); + } + else if( IsOnLayer( LAYER_N_FRONT ) ) + { + aLayers[0] = ITEM_GAL_LAYER( PAD_FR_VISIBLE ); + } + else if( IsOnLayer( LAYER_N_BACK ) ) + { + aLayers[0] = ITEM_GAL_LAYER( PAD_BK_VISIBLE ); + } +#ifdef __WXDEBUG__ + else // Should not occur + { + wxLogWarning( wxT("D_PAD::ViewGetLayers():PAD on layer different than FRONT/BACK") ); + } +#endif + + // Draw a hole aLayers[1] = ITEM_GAL_LAYER( PAD_HOLES_VISIBLE ); aCount = 2;