Check all item layers before bailing.

Fixes: lp:1840986
* https://bugs.launchpad.net/kicad/+bug/1840986
This commit is contained in:
Jeff Young 2019-08-27 20:52:04 +01:00
parent 83f147c414
commit 359ef0372c
1 changed files with 16 additions and 8 deletions

View File

@ -493,16 +493,24 @@ void SCH_PAINTER::draw( LIB_FIELD *aField, int aLayer )
if( drawingShadows && !aField->IsSelected() )
return;
// Must check layer as fields are sometimes drawn by their parent rather than
// directly from the view.
int layers[KIGFX::VIEW::VIEW_MAX_LAYERS];
int layers_count;
aField->ViewGetLayers( layers, layers_count );
if( aLayer != layers[0] )
if( !isUnitAndConversionShown( aField ) )
return;
if( !isUnitAndConversionShown( aField ) )
// Must check layer as fields are sometimes drawn by their parent rather than
// directly from the view.
int layers[KIGFX::VIEW::VIEW_MAX_LAYERS];
int layers_count;
bool foundLayer = false;
aField->ViewGetLayers( layers, layers_count );
for( int i = 0; i < layers_count; ++i )
{
if( layers[i] == aLayer )
foundLayer = true;
}
if( !foundLayer )
return;
COLOR4D color = getRenderColor( aField, aLayer, drawingShadows );