From 8b9161b27dd1398bc9678691cb844aa2e733b546 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 2 Aug 2021 18:24:01 +0100 Subject: [PATCH] Be more careful with alpha value. Fixes https://gitlab.com/kicad/code/kicad/issues/8850 --- pcbnew/pcb_painter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 584baeca38..6d0e15080b 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -1540,7 +1540,7 @@ void PCB_PAINTER::draw( const PCB_TEXT* aText, int aLayer ) return; const COLOR4D& color = m_pcbSettings.GetColor( aText, aText->GetLayer() ); - VECTOR2D position( aText->GetTextPos().x, aText->GetTextPos().y ); + VECTOR2D position( aText->GetTextPos().x, aText->GetTextPos().y ); if( m_pcbSettings.m_sketchText || m_pcbSettings.m_sketchMode[aLayer] ) { @@ -1569,7 +1569,7 @@ void PCB_PAINTER::draw( const FP_TEXT* aText, int aLayer ) return; const COLOR4D& color = m_pcbSettings.GetColor( aText, aLayer ); - VECTOR2D position( aText->GetTextPos().x, aText->GetTextPos().y ); + VECTOR2D position( aText->GetTextPos().x, aText->GetTextPos().y ); if( m_pcbSettings.m_sketchText ) { @@ -1700,16 +1700,16 @@ void PCB_PAINTER::draw( const ZONE* aZone, int aLayer ) if( !aZone->IsOnLayer( layer ) ) return; - COLOR4D color = m_pcbSettings.GetColor( aZone, layer ); + COLOR4D color = m_pcbSettings.GetColor( aZone, layer ); std::deque corners; - ZONE_DISPLAY_MODE displayMode = m_pcbSettings.m_zoneDisplayMode; + ZONE_DISPLAY_MODE displayMode = m_pcbSettings.m_zoneDisplayMode; // Draw the outline const SHAPE_POLY_SET* outline = aZone->Outline(); if( m_pcbSettings.m_zoneOutlines && outline && outline->OutlineCount() > 0 ) { - m_gal->SetStrokeColor( color.WithAlpha( 1.0 ) ); + m_gal->SetStrokeColor( color.a > 0.0 ? color.WithAlpha( 1.0 ) : color ); m_gal->SetIsFill( false ); m_gal->SetIsStroke( true ); m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );