From bbb513e2e584174c2c47694f0b32c515ea8fa64a Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 2 Apr 2018 13:26:31 -0700 Subject: [PATCH] Ensure that we are drawing holes and outlines Set hole colors in output to non-transparent values. Ensure holes are traced when drawing drill marks. Fixes: lp:1646482 * https://bugs.launchpad.net/kicad/+bug/1646482 --- pcbnew/pad_draw_functions.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pcbnew/pad_draw_functions.cpp b/pcbnew/pad_draw_functions.cpp index 61881a9fd8..a87dac001a 100644 --- a/pcbnew/pad_draw_functions.cpp +++ b/pcbnew/pad_draw_functions.cpp @@ -605,38 +605,40 @@ void D_PAD::DrawShape( EDA_RECT* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) if( drawhole ) { bool blackpenstate = false; + COLOR4D fillcolor = aDrawInfo.m_ShowNotPlatedHole? aDrawInfo.m_NPHoleColor : + aDrawInfo.m_HoleColor; + COLOR4D hole_color = fillcolor; if( aDrawInfo.m_IsPrinting ) { + fillcolor = COLOR4D::WHITE; blackpenstate = GetGRForceBlackPenState(); GRForceBlackPen( false ); - aDrawInfo.m_HoleColor = WHITE; - aDrawInfo.m_NPHoleColor = WHITE; } else { GRSetDrawMode( aDC, ( aDrawInfo.m_DrawMode != GR_XOR ) ? GR_COPY : GR_XOR ); } - COLOR4D hole_color = aDrawInfo.m_HoleColor; - - if( aDrawInfo. m_ShowNotPlatedHole ) // Draw a specific hole color - hole_color = aDrawInfo.m_NPHoleColor; + if( blackpenstate ) + hole_color = COLOR4D::BLACK; switch( GetDrillShape() ) { case PAD_DRILL_SHAPE_CIRCLE: if( aDC->LogicalToDeviceXRel( hole ) > 1 ) // hole is drawn if hole > 1pixel GRFilledCircle( aClipBox, aDC, holepos.x, holepos.y, hole, 0, - hole_color, hole_color ); + hole_color, fillcolor ); break; case PAD_DRILL_SHAPE_OBLONG: { wxPoint drl_start, drl_end; GetOblongDrillGeometry( drl_start, drl_end, seg_width ); - GRFilledSegment( aClipBox, aDC, holepos + drl_start, - holepos + drl_end, seg_width, hole_color ); + drl_start += holepos; + drl_end += holepos; + GRFilledSegment( aClipBox, aDC, drl_start, drl_end, seg_width, fillcolor ); + GRCSegm( aClipBox, aDC, drl_start, drl_end, seg_width, hole_color ); } break;