diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 23ad1c1368..114aff2191 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -1436,6 +1436,13 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer ) m_gal->SetIsStroke( false ); double widthFactor = ADVANCED_CFG::GetCfg().m_HoleWallPaintingMultiplier; double lineWidth = widthFactor * m_holePlatingThickness; + + // Prevent the hole wall from being drawn too thin (at least two pixels) + // or too thick (cap at the size of the pad ) + lineWidth = std::max( lineWidth, 2.0 / m_gal->GetWorldScale() ); + lineWidth = std::min( lineWidth, aPad->GetSizeX() / 2.0 ); + lineWidth = std::min( lineWidth, aPad->GetSizeY() / 2.0 ); + m_gal->SetFillColor( color ); std::shared_ptr slot = aPad->GetEffectiveHoleShape();