Don't make clients deal with nested SHAPE_COMPOUNDs.

This commit is contained in:
Jeff Young 2020-10-25 15:01:55 +00:00
parent fd62c42ded
commit 31cc100669
1 changed files with 14 additions and 1 deletions

View File

@ -75,7 +75,20 @@ public:
void AddShape( SHAPE* aShape )
{
m_shapes.push_back( aShape );
// Don't make clients deal with nested SHAPE_COMPOUNDs
if( aShape->HasIndexableSubshapes() )
{
std::vector<SHAPE*> subshapes;
aShape->GetIndexableSubshapes( subshapes );
for( SHAPE* subshape : subshapes )
m_shapes.push_back( subshape );
}
else
{
m_shapes.push_back( aShape );
}
m_dirty = true;
}