Properties: Add shape fill control

This commit is contained in:
Jon Evans 2022-12-22 17:44:31 -05:00
parent 4a0588db7a
commit 826f641dff
1 changed files with 21 additions and 0 deletions

View File

@ -1715,5 +1715,26 @@ static struct EDA_SHAPE_DESC
return aItem->Get<SHAPE_T>( shape ) == SHAPE_T::ARC;
} );
propMgr.AddProperty( angle );
auto filled = new PROPERTY<EDA_SHAPE, bool>( _HKI( "Filled" ),
&EDA_SHAPE::SetFilled, &EDA_SHAPE::IsFilled );
filled->SetAvailableFunc(
[=]( INSPECTABLE* aItem ) -> bool
{
SHAPE_T itemShape = aItem->Get<SHAPE_T>( shape );
switch( itemShape )
{
case SHAPE_T::POLY:
case SHAPE_T::RECT:
case SHAPE_T::CIRCLE:
return true;
default:
return false;
}
} );
propMgr.AddProperty( filled );
}
} _EDA_SHAPE_DESC;