Commit 7ce91d4e authored by Maciej Suminski's avatar Maciej Suminski

Fixed zone area removal (& undoing) using the EDIT_TOOL.

parent fb784323
...@@ -303,16 +303,7 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem ) ...@@ -303,16 +303,7 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem )
{ {
MODULE* module = static_cast<MODULE*>( aItem ); MODULE* module = static_cast<MODULE*>( aItem );
module->ClearFlags(); module->ClearFlags();
module->RunOnChildren( std::bind1st( std::mem_fun( &KIGFX::VIEW::Remove ), getView() ) );
for( D_PAD* pad = module->Pads().GetFirst(); pad; pad = pad->Next() )
getView()->Remove( pad );
for( BOARD_ITEM* drawing = module->GraphicalItems().GetFirst(); drawing;
drawing = drawing->Next() )
getView()->Remove( drawing );
getView()->Remove( &module->Reference() );
getView()->Remove( &module->Value() );
// Module itself is deleted after the switch scope is finished // Module itself is deleted after the switch scope is finished
// list of pads is rebuild by BOARD::BuildListOfNets() // list of pads is rebuild by BOARD::BuildListOfNets()
...@@ -322,11 +313,6 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem ) ...@@ -322,11 +313,6 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem )
} }
break; break;
case PCB_ZONE_AREA_T:
getView()->Remove( aItem );
getModel<BOARD>( PCB_T )->Delete( aItem );
return;
// These are not supposed to be removed // These are not supposed to be removed
case PCB_PAD_T: case PCB_PAD_T:
case PCB_MODULE_TEXT_T: case PCB_MODULE_TEXT_T:
...@@ -341,6 +327,7 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem ) ...@@ -341,6 +327,7 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem )
case PCB_TARGET_T: // a target (graphic item) case PCB_TARGET_T: // a target (graphic item)
case PCB_MARKER_T: // a marker used to show something case PCB_MARKER_T: // a marker used to show something
case PCB_ZONE_T: // SEG_ZONE items are now deprecated case PCB_ZONE_T: // SEG_ZONE items are now deprecated
case PCB_ZONE_AREA_T:
break; break;
default: // other types do not need to (or should not) be handled default: // other types do not need to (or should not) be handled
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment