From 09eee84a3e4437c8b5de4b576b7787f92b623c5b Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 14 Jun 2020 07:04:15 -0700 Subject: [PATCH] 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 --- pcbnew/tools/edit_tool.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index e2c9fd6eab..659188655c 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -965,6 +965,17 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent ) } break; + case PCB_MODULE_ZONE_AREA_T: + { + auto zone = static_cast( item ); + auto parent = static_cast( 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.