FP_TEXT::ViewGetLOD() fix incorrect test (LAYER_MOD_VALUES color has no matter)

Fixes #11026
https://gitlab.com/kicad/code/kicad/issues/11026
Fixes #11028
This commit is contained in:
jean-pierre charras 2022-03-03 11:57:19 +01:00
parent a0d68b8426
commit 27db23eba0
1 changed files with 2 additions and 6 deletions

View File

@ -372,13 +372,10 @@ double FP_TEXT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
if( !aView->IsLayerVisible( GetLayer() ) )
return HIDE;
RENDER_SETTINGS* renderSettings = aView->GetPainter()->GetSettings();
// Handle Render tab switches
if( m_Type == TEXT_is_VALUE || GetText() == wxT( "${VALUE}" ) )
{
if( !aView->IsLayerVisible( LAYER_MOD_VALUES )
|| renderSettings->GetLayerColor( LAYER_MOD_VALUES ) == COLOR4D::UNSPECIFIED )
if( !aView->IsLayerVisible( LAYER_MOD_VALUES ) )
{
return HIDE;
}
@ -386,8 +383,7 @@ double FP_TEXT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
if( m_Type == TEXT_is_REFERENCE || GetText() == wxT( "${REFERENCE}" ) )
{
if( !aView->IsLayerVisible( LAYER_MOD_REFERENCES )
|| renderSettings->GetLayerColor( LAYER_MOD_REFERENCES ) == COLOR4D::UNSPECIFIED )
if( !aView->IsLayerVisible( LAYER_MOD_REFERENCES ) )
{
return HIDE;
}