Properties: disable pad y-size when circular
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15038
This commit is contained in:
parent
39a5929f33
commit
39073642a7
|
@ -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 );
|
||||||
|
|
Loading…
Reference in New Issue