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
This commit is contained in:
Jeff Young 2023-11-22 14:36:29 +00:00
parent 4a25ef164d
commit 85f760fc66
1 changed files with 2 additions and 5 deletions

View File

@ -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<PCB_MARKER*>( aMarker )->SetZoom( 1.0 / sqrt( m_gal->GetZoomFactor() ) );