From ac3bf11bc4e44e033ef1ce6e2f7e8f03236576c0 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 5 Feb 2018 19:50:02 +0100 Subject: [PATCH] Fix a minor render issue in GAL mode: hole contours inside a zone outline are not drawn. --- pcbnew/pcb_painter.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 7f8b7c1059..f44128d060 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -1072,8 +1072,25 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone, int aLayer ) m_gal->SetIsFill( false ); m_gal->SetIsStroke( true ); m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth ); - m_gal->DrawPolygon( *outline ); + // Draw each contour (main contour and holes) + + /* This line: + * m_gal->DrawPolygon( *outline ); + * should be enough, but currently does not work to draw holes contours in a complex polygon + * so each contour is draw as a simple polygon + */ + + // Draw the main contour + m_gal->DrawPolyline( outline->COutline( 0 ) ); + + // Draw holes + int holes_count = outline->HoleCount( 0 ); + + for( int ii = 0; ii < holes_count; ++ii ) + m_gal->DrawPolyline( outline->CHole( 0, ii ) ); + + // Draw hatch lines for( const SEG& hatchLine : aZone->GetHatchLines() ) m_gal->DrawLine( hatchLine.A, hatchLine.B ); }