pcbnew: Handle module zone area in delete

Selections containing zone areas need to be handled separately by
modifying the parent rather than the item itself

Fixes https://gitlab.com/kicad/code/kicad/issues/4653
This commit is contained in:
Seth Hillbrand 2020-06-14 07:04:15 -07:00
parent 810f668d45
commit 09eee84a3e
1 changed files with 11 additions and 0 deletions

View File

@ -965,6 +965,17 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
}
break;
case PCB_MODULE_ZONE_AREA_T:
{
auto zone = static_cast<MODULE_ZONE_CONTAINER*>( item );
auto parent = static_cast<MODULE*>( item->GetParent() );
m_commit->Modify( parent );
getView()->Remove( zone );
parent->Remove( zone );
}
break;
case PCB_ZONE_AREA_T:
// We process the zones special so that cutouts can be deleted when the delete tool
// is called from inside a cutout when the zone is selected.