Coverity fix.

This commit is contained in:
Jeff Young 2021-06-06 17:57:26 +01:00
parent 17da050e69
commit 0d7e48d5b1
1 changed files with 3 additions and 2 deletions

View File

@ -361,8 +361,6 @@ void FP_TEXT::ViewGetLayers( int aLayers[], int& aCount ) const
double FP_TEXT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const double FP_TEXT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
{ {
constexpr double HIDE = (double)std::numeric_limits<double>::max(); constexpr double HIDE = (double)std::numeric_limits<double>::max();
RENDER_SETTINGS* renderSettings = aView->GetPainter()->GetSettings();
COLOR4D backgroundColor = renderSettings->GetLayerColor( LAYER_PCB_BACKGROUND );
if( !aView ) if( !aView )
return 0.0; return 0.0;
@ -372,6 +370,9 @@ double FP_TEXT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
if( !aView->IsLayerVisible( GetLayer() ) ) if( !aView->IsLayerVisible( GetLayer() ) )
return HIDE; return HIDE;
RENDER_SETTINGS* renderSettings = aView->GetPainter()->GetSettings();
COLOR4D backgroundColor = renderSettings->GetLayerColor( LAYER_PCB_BACKGROUND );
// Handle Render tab switches // Handle Render tab switches
if( m_Type == TEXT_is_VALUE || GetText() == wxT( "${VALUE}" ) ) if( m_Type == TEXT_is_VALUE || GetText() == wxT( "${VALUE}" ) )
{ {