Properties: disable pad y-size when circular

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15038
This commit is contained in:
Jon Evans 2023-06-22 19:19:33 -04:00
parent 39a5929f33
commit 39073642a7
1 changed files with 10 additions and 1 deletions

View File

@ -1802,7 +1802,16 @@ static struct PAD_DESC
PROPERTY_DISPLAY::PT_SIZE ), groupPad ); PROPERTY_DISPLAY::PT_SIZE ), groupPad );
propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Size Y" ), propMgr.AddProperty( new PROPERTY<PAD, int>( _HKI( "Size Y" ),
&PAD::SetSizeY, &PAD::GetSizeY, &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( "Corner Radius Ratio" ), auto roundRadiusRatio = new PROPERTY<PAD, double>( _HKI( "Corner Radius Ratio" ),
&PAD::SetRoundRectRadiusRatio, &PAD::GetRoundRectRadiusRatio ); &PAD::SetRoundRectRadiusRatio, &PAD::GetRoundRectRadiusRatio );