From d087ede21db0842496adab1b7ce9db5ecd1598fb Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Tue, 23 Feb 2021 20:07:19 -0500 Subject: [PATCH] Don't show ratsnest on layers hidden by contrast mode Fixes https://gitlab.com/kicad/code/kicad/-/issues/7667 --- pcbnew/ratsnest/ratsnest_view_item.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pcbnew/ratsnest/ratsnest_view_item.cpp b/pcbnew/ratsnest/ratsnest_view_item.cpp index 134832842c..0db84564d8 100644 --- a/pcbnew/ratsnest/ratsnest_view_item.cpp +++ b/pcbnew/ratsnest/ratsnest_view_item.cpp @@ -88,9 +88,17 @@ void RATSNEST_VIEW_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const LSET visibleLayers; - for( PCB_LAYER_ID layer : LSET::AllCuMask().Seq() ) - if( aView->IsLayerVisible( layer ) ) - visibleLayers.set( layer ); + // If we are in "other layers off" mode, the active layer is the only visible layer + if( rs->GetContrastModeDisplay() == HIGH_CONTRAST_MODE::HIDDEN ) + { + visibleLayers.set( rs->GetPrimaryHighContrastLayer() ); + } + else + { + for( PCB_LAYER_ID layer : LSET::AllCuMask().Seq() ) + if( aView->IsLayerVisible( layer ) ) + visibleLayers.set( layer ); + } const bool curved_ratsnest = rs->GetCurvedRatsnestLinesEnabled();