Eeschema plot: fix incorrect background color used to generate dimmed color.
This is for a LIB_TEXT and a SCH_FIELD. Fixes #12709 https://gitlab.com/kicad/code/kicad/issues/12709
This commit is contained in:
parent
38c863c3f4
commit
75a3209e55
|
@ -282,14 +282,14 @@ void LIB_TEXT::Plot( PLOTTER* plotter, bool aBackground, const VECTOR2I& offset,
|
||||||
int t1 = ( aTransform.x1 != 0 ) ^ ( GetTextAngle() != ANGLE_HORIZONTAL );
|
int t1 = ( aTransform.x1 != 0 ) ^ ( GetTextAngle() != ANGLE_HORIZONTAL );
|
||||||
VECTOR2I pos = aTransform.TransformCoordinate( txtpos ) + offset;
|
VECTOR2I pos = aTransform.TransformCoordinate( txtpos ) + offset;
|
||||||
COLOR4D color = GetTextColor();
|
COLOR4D color = GetTextColor();
|
||||||
COLOR4D bg = settings->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND );
|
COLOR4D bg = settings->GetBackgroundColor();
|
||||||
|
|
||||||
if( !plotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
|
if( !plotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
|
||||||
color = settings->GetLayerColor( LAYER_DEVICE );
|
color = settings->GetLayerColor( LAYER_DEVICE );
|
||||||
|
|
||||||
if( !IsVisible() )
|
if( !IsVisible() )
|
||||||
bg = settings->GetLayerColor( LAYER_HIDDEN );
|
bg = settings->GetLayerColor( LAYER_HIDDEN );
|
||||||
else if( !plotter->GetColorMode() )
|
else if( bg == COLOR4D::UNSPECIFIED || !plotter->GetColorMode() )
|
||||||
bg = COLOR4D::WHITE;
|
bg = COLOR4D::WHITE;
|
||||||
|
|
||||||
if( aDimmed )
|
if( aDimmed )
|
||||||
|
|
|
@ -965,14 +965,11 @@ void SCH_FIELD::Plot( PLOTTER* aPlotter, bool aBackground ) const
|
||||||
COLOR4D color = settings->GetLayerColor( GetLayer() );
|
COLOR4D color = settings->GetLayerColor( GetLayer() );
|
||||||
int penWidth = GetEffectiveTextPenWidth( settings->GetDefaultPenWidth() );
|
int penWidth = GetEffectiveTextPenWidth( settings->GetDefaultPenWidth() );
|
||||||
|
|
||||||
COLOR4D bg = settings->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND );
|
COLOR4D bg = settings->GetBackgroundColor();;
|
||||||
|
|
||||||
if( !aPlotter->GetColorMode() )
|
if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
|
||||||
bg = COLOR4D::WHITE;
|
bg = COLOR4D::WHITE;
|
||||||
|
|
||||||
if( SCH_SYMBOL* parent = dyn_cast<SCH_SYMBOL*>( m_parent ); parent && parent->GetDNP() )
|
|
||||||
color = color.Mix( bg, 0.5f );
|
|
||||||
|
|
||||||
if( aPlotter->GetColorMode() && GetTextColor() != COLOR4D::UNSPECIFIED )
|
if( aPlotter->GetColorMode() && GetTextColor() != COLOR4D::UNSPECIFIED )
|
||||||
color = GetTextColor();
|
color = GetTextColor();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue