From b47f172e577f87c336e2c8822c75d8d20bd79810 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 12 Jul 2023 12:47:36 +0200 Subject: [PATCH] PCB_VIA::SetLayerSet( LSET aLayerSet ): fix bug: it must consider only copper layers. Its purpose is to initialize the top and the bottom copper layers connected by this via. So only copper layers in LSET must be analyzed. --- pcbnew/pcb_track.cpp | 4 ++++ pcbnew/pcb_track.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/pcbnew/pcb_track.cpp b/pcbnew/pcb_track.cpp index 1bfa127818..c88a042503 100644 --- a/pcbnew/pcb_track.cpp +++ b/pcbnew/pcb_track.cpp @@ -530,6 +530,10 @@ void PCB_VIA::SetLayerSet( LSET aLayerSet ) for( PCB_LAYER_ID layer : aLayerSet.Seq() ) { + // m_layer and m_bottomLayer are copper layers, so consider only copper layers in aLayerSet + if( !IsCopperLayer( layer ) ) + continue; + if( first ) { m_layer = layer; diff --git a/pcbnew/pcb_track.h b/pcbnew/pcb_track.h index 827f027d79..47c7a808f9 100644 --- a/pcbnew/pcb_track.h +++ b/pcbnew/pcb_track.h @@ -407,6 +407,11 @@ public: bool IsOnLayer( PCB_LAYER_ID aLayer, bool aIncludeCourtyards = false ) const override; virtual LSET GetLayerSet() const override; + + /** + * Note SetLayerSet() initialize the first and last copper layers connected by the via. + * So currently SetLayerSet ignore non copper layers + */ virtual void SetLayerSet( LSET aLayers ) override; /**