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; /**