Respect item polarity when redrawing cached gerber view items
Fixes: lp:1746825 * https://bugs.launchpad.net/kicad/+bug/1746825
This commit is contained in:
parent
b0d1e49319
commit
1f487593fa
|
@ -92,6 +92,7 @@ void GERBVIEW_RENDER_SETTINGS::LoadDisplayOptions( const GBR_DISPLAY_OPTIONS* aO
|
||||||
const COLOR4D& GERBVIEW_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const
|
const COLOR4D& GERBVIEW_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const
|
||||||
{
|
{
|
||||||
const GERBER_DRAW_ITEM* item = static_cast<const GERBER_DRAW_ITEM*>( aItem );
|
const GERBER_DRAW_ITEM* item = static_cast<const GERBER_DRAW_ITEM*>( aItem );
|
||||||
|
static const COLOR4D transparent = COLOR4D( 0, 0, 0, 0 );
|
||||||
|
|
||||||
// All DCODE layers stored under a single color setting
|
// All DCODE layers stored under a single color setting
|
||||||
if( IsDCodeLayer( aLayer ) )
|
if( IsDCodeLayer( aLayer ) )
|
||||||
|
@ -101,6 +102,14 @@ const COLOR4D& GERBVIEW_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int a
|
||||||
{
|
{
|
||||||
if( item->IsSelected() )
|
if( item->IsSelected() )
|
||||||
return m_layerColorsSel[aLayer];
|
return m_layerColorsSel[aLayer];
|
||||||
|
|
||||||
|
if( item->GetLayerPolarity() )
|
||||||
|
{
|
||||||
|
if( m_showNegativeItems )
|
||||||
|
return m_layerColors[LAYER_NEGATIVE_OBJECTS];
|
||||||
|
else
|
||||||
|
return transparent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !m_netHighlightString.IsEmpty() && item &&
|
if( !m_netHighlightString.IsEmpty() && item &&
|
||||||
|
@ -219,14 +228,7 @@ void GERBVIEW_PAINTER::draw( /*const*/ GERBER_DRAW_ITEM* aItem, int aLayer )
|
||||||
if( aItem->IsBrightened() )
|
if( aItem->IsBrightened() )
|
||||||
color = COLOR4D( 0.0, 1.0, 0.0, 0.75 );
|
color = COLOR4D( 0.0, 1.0, 0.0, 0.75 );
|
||||||
|
|
||||||
if( isNegative )
|
if( m_gerbviewSettings.m_diffMode )
|
||||||
{
|
|
||||||
if( m_gerbviewSettings.m_showNegativeItems )
|
|
||||||
color = m_gerbviewSettings.GetLayerColor( LAYER_NEGATIVE_OBJECTS );
|
|
||||||
else
|
|
||||||
color = COLOR4D( 0, 0, 0, 0 );
|
|
||||||
}
|
|
||||||
else if( m_gerbviewSettings.m_diffMode )
|
|
||||||
{
|
{
|
||||||
color.a = 0.75;
|
color.a = 0.75;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue