diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 68c8551a5e..41b47ed416 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -1038,8 +1038,35 @@ unsigned int VIA::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const BOARD* board = GetBoard(); // Only draw the via if at least one of the layers it crosses is being displayed - if( board && ( board->GetVisibleLayers() & GetLayerSet() ).any() ) + if( board && ( board->GetVisibleLayers() & GetLayerSet() ).any() + && aView->IsLayerVisible( LAYER_VIAS ) ) + { + switch( m_ViaType ) + { + case VIA_THROUGH: + if( !aView->IsLayerVisible( LAYER_VIA_THROUGH ) ) + return HIDE; + + break; + + case VIA_BLIND_BURIED: + if( !aView->IsLayerVisible( LAYER_VIA_BBLIND ) ) + return HIDE; + + break; + + case VIA_MICROVIA: + if( !aView->IsLayerVisible( LAYER_VIA_MICROVIA ) ) + return HIDE; + + break; + + default: + break; + } + return 0; + } return HIDE; } diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index dddf5dd1ca..e82d1c2a3b 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -1779,7 +1779,8 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn } // All other items are selected only if the layer on which they exist is visible - return board()->IsLayerVisible( aItem->GetLayer() ); + return board()->IsLayerVisible( aItem->GetLayer() ) + && aItem->ViewGetLOD( aItem->GetLayer(), view() ) < view()->GetScale(); }