Objects on UNDEFINED_LAYER should return an empty layerset.

Fixes https://gitlab.com/kicad/code/kicad/issues/10417
This commit is contained in:
Jeff Young 2022-01-14 17:25:45 +00:00
parent 728ca8265f
commit b3c324b352
1 changed files with 8 additions and 1 deletions

View File

@ -156,7 +156,14 @@ public:
/**
* Return a std::bitset of all layers on which the item physically resides.
*/
virtual LSET GetLayerSet() const { return LSET( m_layer ); }
virtual LSET GetLayerSet() const
{
if( m_layer == UNDEFINED_LAYER )
return LSET();
else
return LSET( m_layer );
}
virtual void SetLayerSet( LSET aLayers )
{
wxFAIL_MSG( "Attempted to SetLayerSet() on a single-layer object." );