From 9ac5f837f7e47a7d4a2b6b29d71bdbcd80b01b57 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 22 Jun 2023 19:19:33 -0400 Subject: [PATCH] Properties: disable pad y-size when circular Fixes https://gitlab.com/kicad/code/kicad/-/issues/15038 (cherry picked from commit 39073642a759e942c8a4846c5b0b085140a74970) --- pcbnew/pad.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pcbnew/pad.cpp b/pcbnew/pad.cpp index 8d629130c7..fecddf2b6b 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -1825,7 +1825,16 @@ static struct PAD_DESC PROPERTY_DISPLAY::PT_SIZE ), groupPad ); propMgr.AddProperty( new PROPERTY( _HKI( "Size Y" ), &PAD::SetSizeY, &PAD::GetSizeY, - PROPERTY_DISPLAY::PT_SIZE ), groupPad ); + PROPERTY_DISPLAY::PT_SIZE ), groupPad ) + .SetAvailableFunc( + [=]( INSPECTABLE* aItem ) -> bool + { + // Circle pads have no usable y-size + if( PAD* pad = dynamic_cast( aItem ) ) + return pad->GetShape() != PAD_SHAPE::CIRCLE; + + return true; + } ); auto roundRadiusRatio = new PROPERTY( _HKI( "Round Radius Ratio" ), &PAD::SetRoundRectRadiusRatio, &PAD::GetRoundRectRadiusRatio );