From e59d8b0a2da3f41d180a85b07bcf6ff64812d6bf Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 28 Jul 2022 00:12:25 +0100 Subject: [PATCH] Fix up merge errors. --- pcbnew/pcb_painter.cpp | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 3c8839537b..0fa34b7703 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -827,34 +827,35 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer ) default: wxASSERT( false ); break; } + m_gal->SetStrokeColor( color ); + m_gal->SetFillColor( color ); + m_gal->SetIsStroke( true ); + m_gal->SetIsFill( false ); + if( sketchMode ) - { - // Outline mode - m_gal->SetIsStroke( true ); - m_gal->SetIsFill( false ); m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth ); - m_gal->SetStrokeColor( color ); - } - else - { - // Filled mode - m_gal->SetIsFill( true ); - m_gal->SetIsStroke( false ); - m_gal->SetFillColor( color ); - } if( aLayer == LAYER_VIA_HOLES ) { + m_gal->SetIsStroke( false ); + m_gal->SetIsFill( true ); m_gal->DrawCircle( center, getDrillSize( aVia ) / 2.0 ); } else if( aLayer == LAYER_VIA_THROUGH || m_pcbSettings.IsPrinting() ) { + int annular_width = ( aVia->GetWidth() - getDrillSize( aVia ) ) / 2.0; double radius = aVia->GetWidth() / 2.0; bool draw = aLayer == LAYER_VIA_THROUGH; if( m_pcbSettings.IsPrinting() ) draw = aVia->FlashLayer( m_pcbSettings.GetPrintLayers() ); + if( !sketchMode ) + { + m_gal->SetLineWidth( annular_width ); + radius -= annular_width / 2.0; + } + if( draw ) m_gal->DrawCircle( center, radius ); } @@ -868,7 +869,11 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer ) double radius = aVia->GetWidth() / 2.0; if( !sketchMode ) + { + m_gal->SetIsFill( true ); + m_gal->SetIsStroke( false ); m_gal->SetLineWidth( ( aVia->GetWidth() - aVia->GetDrillValue() ) / 2.0 ); + } m_gal->DrawArc( center, radius, M_PI * -0.375, M_PI * 0.375 ); m_gal->DrawArc( center, radius, M_PI * 0.625, M_PI * 1.375 );