From f24048e8dadb766b0ad5666c12789f5dec443b56 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 22 Apr 2013 12:13:48 +0200 Subject: [PATCH] Drawing SMD pads with colors defined by "Pads Front"/"Pads Back" color settings. --- pcbnew/basepcbframe.cpp | 6 +++--- pcbnew/class_pad.cpp | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 6b48ea89ac..68b9a6d234 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -98,9 +98,9 @@ const int m_galLayerOrder[] = ITEM_GAL_LAYER( VIA_HOLES_VISIBLE ), ITEM_GAL_LAYER( PAD_HOLES_VISIBLE ), ITEM_GAL_LAYER( VIAS_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ), - LAYER_N_FRONT, LAYER_N_15, LAYER_N_14, LAYER_N_13, LAYER_N_12, LAYER_N_11, - LAYER_N_10, LAYER_N_9, LAYER_N_8, LAYER_N_7, LAYER_N_6, LAYER_N_5, LAYER_N_4, - LAYER_N_3, LAYER_N_2, LAYER_N_BACK, + ITEM_GAL_LAYER( PAD_FR_VISIBLE ), LAYER_N_FRONT, LAYER_N_15, LAYER_N_14, LAYER_N_13, + LAYER_N_12, LAYER_N_11, LAYER_N_10, LAYER_N_9, LAYER_N_8, LAYER_N_7, LAYER_N_6, + LAYER_N_5, LAYER_N_4, LAYER_N_3, LAYER_N_2, ITEM_GAL_LAYER( PAD_BK_VISIBLE ), LAYER_N_BACK, SOLDERMASK_N_BACK, ADHESIVE_N_BACK, SOLDERPASTE_N_BACK, SILKSCREEN_N_BACK, ITEM_GAL_LAYER( MOD_TEXT_BK_VISIBLE ) diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index a974bfcb08..379001647e 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -765,15 +765,26 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const if( m_Attribute == PAD_SMD || m_Attribute == PAD_CONN) { // Single layer pad (smd) without hole - aLayers[0] = GetParent()->GetLayer(); - aCount = 1; + 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 + + aCount = 1; } else { // Multi layer pad with hole - pad is shown on one common layer, hole on the other aLayers[0] = ITEM_GAL_LAYER( PADS_VISIBLE ); aLayers[1] = ITEM_GAL_LAYER( PAD_HOLES_VISIBLE ); - aCount = 2; + + aCount = 2; } }