From 85f760fc660b6b836dcb5b6c773c093504310b5e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 22 Nov 2023 14:36:29 +0000 Subject: [PATCH] Run IsElementVisible() test on all markers, not just their shadows. The view item doesn't always get its layers updated early enough for the paint. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16138 --- pcbnew/pcb_painter.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index c7747ca15d..bd4cd69e45 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -2608,13 +2608,10 @@ void PCB_PAINTER::draw( const PCB_MARKER* aMarker, int aLayer ) { bool isShadow = aLayer == LAYER_MARKER_SHADOWS; - // Don't paint shadows for invisible markers. + // Don't paint invisible markers. // It would be nice to do this through layer dependencies but we can't do an "or" there today - if( isShadow && aMarker->GetBoard() - && !aMarker->GetBoard()->IsElementVisible( aMarker->GetColorLayer() ) ) - { + if( aMarker->GetBoard() && !aMarker->GetBoard()->IsElementVisible( aMarker->GetColorLayer() ) ) return; - } const_cast( aMarker )->SetZoom( 1.0 / sqrt( m_gal->GetZoomFactor() ) );