Properties: disable pad y-size when circular

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15038


(cherry picked from commit 39073642a7)
This commit is contained in:
Jon Evans 2023-06-22 19:19:33 -04:00
parent 033ab9ac71
commit 9ac5f837f7
1 changed files with 10 additions and 1 deletions

View File

@ -1825,7 +1825,16 @@ static struct PAD_DESC
PROPERTY_DISPLAY::PT_SIZE ), groupPad );
propMgr.AddProperty( new PROPERTY<PAD, int>( _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<PAD*>( aItem ) )
return pad->GetShape() != PAD_SHAPE::CIRCLE;
return true;
} );
auto roundRadiusRatio = new PROPERTY<PAD, double>( _HKI( "Round Radius Ratio" ),
&PAD::SetRoundRectRadiusRatio, &PAD::GetRoundRectRadiusRatio );