From b02a449be874811f0aa03a0bd044a00e45505ff1 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 22 Feb 2025 13:31:51 -0800 Subject: [PATCH] Limit the size of the PTH hole walls Should always be at least 2px thick but no larger than the minimum thickness of the pad (walls do not extend beyond the pad itself) --- pcbnew/pcb_painter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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();