kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #34009
Re: Pads front and F.Cu visibility, possible bugs?
There is a simple fix to this problem, patch in attachment. It needs to
be applied on top of this patch:
https://bugs.launchpad.net/kicad/+bug/1743890
Witch this patch there is another issue: when all layers (in Layer tab)
are hidden, anchors and invisible text are still displayed.
I'm not sure what to do about it, maybe they also should be hidden?
Cheers,
Andrzej
On 02/07/2018 04:24 PM, Kristoffer Ödmark wrote:
Hey!
Another confusion arised when I was speaking to a friend. When
disabling the F.Cu layer, the pads are still visible. I can understand
the need to be able to disable the pads on the front layer separate
from everything else, to check for things under pads etc.
What I cannot understand is why the pads are visible if I want to
disable the entire front layer in pcbnew, also if one wants
transparent layers, one can actually se the compositioning for the
front pads and front traces, and allowing them to be different colors
also seem a bit confusing actually.
I could basically change the front pad colors to look like they belong
to the back layer, I know its stupid, but this seems like the kind of
thing one would not want to even be possible, except maybe for pranks.
TLDR;
Possible bugs:
1. pads not affected by layer visibility setting
2. pads and layer compositioning even when same setting
3. pads and corresponding layer color setting
Possible solution:
1. Both layer and pads setting must be enabled for pads to render.
2. Seems hard, Dont know
3. pads and layer share color setting, not necessarily opacity setting.
Comments on these?
>From 2c624e9ce413a6066c589c77cb0aedfeb2e0dea7 Mon Sep 17 00:00:00 2001
From: Andrzej Wolski <awolski.kicad@xxxxxxxxx>
Date: Sat, 17 Feb 2018 23:53:44 +0100
Subject: [PATCH 2/2] Do not draw pads on hidden copper layers.
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------2.7.4"
This is a multi-part message in MIME format.
--------------2.7.4
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
---
pcbnew/class_pad.cpp | 5 +++++
pcbnew/pcb_draw_panel_gal.cpp | 2 ++
2 files changed, 7 insertions(+)
--------------2.7.4
Content-Type: text/x-patch; name="0002-Do-not-draw-pads-on-hidden-copper-layers.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0002-Do-not-draw-pads-on-hidden-copper-layers.patch"
diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp
index 379cf45..75540aa 100644
--- a/pcbnew/class_pad.cpp
+++ b/pcbnew/class_pad.cpp
@@ -1276,6 +1276,7 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const
unsigned int D_PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
{
const int HIDE = std::numeric_limits<unsigned int>::max();
+ BOARD* board = GetBoard();
// Handle Render tab switches
if( ( GetAttribute() == PAD_ATTRIB_STANDARD || GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED )
@@ -1294,6 +1295,10 @@ unsigned int D_PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
if( IsBackLayer( ( PCB_LAYER_ID )aLayer ) && !aView->IsLayerVisible( LAYER_PAD_BK ) )
return HIDE;
+ // Only draw the pad if at least one of the layers it crosses is being displayed
+ if( board && !( board->GetVisibleLayers() & GetLayerSet() ).any() )
+ return HIDE;
+
// Netnames will be shown only if zoom is appropriate
if( IsNetnameLayer( aLayer ) )
{
diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp
index d9476fc..d4f7f2a 100644
--- a/pcbnew/pcb_draw_panel_gal.cpp
+++ b/pcbnew/pcb_draw_panel_gal.cpp
@@ -446,10 +446,12 @@ void PCB_DRAW_PANEL_GAL::setDefaultLayerDeps()
m_view->SetRequired( LAYER_PADS_NETNAMES, LAYER_PADS_TH );
// Front modules
+ m_view->SetRequired( LAYER_PAD_FR, F_Cu );
m_view->SetRequired( LAYER_MOD_TEXT_FR, LAYER_MOD_FR );
m_view->SetRequired( LAYER_PAD_FR_NETNAMES, LAYER_PAD_FR );
// Back modules
+ m_view->SetRequired( LAYER_PAD_BK, B_Cu );
m_view->SetRequired( LAYER_MOD_TEXT_BK, LAYER_MOD_BK );
m_view->SetRequired( LAYER_PAD_BK_NETNAMES, LAYER_PAD_BK );
--------------2.7.4--
Follow ups
References