Remove special cases for footprint editor. BOARD_COMMIT handles them.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16236
This commit is contained in:
parent
b13590f4c0
commit
6e245d5eb4
|
@ -2135,17 +2135,7 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut )
|
||||||
case PCB_DIM_RADIAL_T:
|
case PCB_DIM_RADIAL_T:
|
||||||
case PCB_DIM_ORTHOGONAL_T:
|
case PCB_DIM_ORTHOGONAL_T:
|
||||||
case PCB_GROUP_T:
|
case PCB_GROUP_T:
|
||||||
if( parentFP )
|
commit.Remove( board_item );
|
||||||
{
|
|
||||||
commit.Modify( parentFP );
|
|
||||||
getView()->Remove( board_item );
|
|
||||||
parentFP->Remove( board_item );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
commit.Remove( board_item );
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCB_PAD_T:
|
case PCB_PAD_T:
|
||||||
|
@ -2159,48 +2149,38 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCB_ZONE_T:
|
case PCB_ZONE_T:
|
||||||
if( parentFP )
|
// 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.
|
||||||
|
// Only interact with cutouts when deleting and a single item is selected
|
||||||
|
if( !aIsCut && aItems.GetSize() == 1 )
|
||||||
{
|
{
|
||||||
commit.Modify( parentFP );
|
VECTOR2I curPos = getViewControls()->GetCursorPosition();
|
||||||
getView()->Remove( board_item );
|
ZONE* zone = static_cast<ZONE*>( board_item );
|
||||||
parentFP->Remove( board_item );
|
|
||||||
}
|
int outlineIdx, holeIdx;
|
||||||
else
|
|
||||||
{
|
if( zone->HitTestCutout( curPos, &outlineIdx, &holeIdx ) )
|
||||||
// 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.
|
|
||||||
// Only interact with cutouts when deleting and a single item is selected
|
|
||||||
if( !aIsCut && aItems.GetSize() == 1 )
|
|
||||||
{
|
{
|
||||||
VECTOR2I curPos = getViewControls()->GetCursorPosition();
|
// Remove the cutout
|
||||||
ZONE* zone = static_cast<ZONE*>( board_item );
|
commit.Modify( zone );
|
||||||
|
zone->RemoveCutout( outlineIdx, holeIdx );
|
||||||
|
zone->UnFill();
|
||||||
|
|
||||||
int outlineIdx, holeIdx;
|
// TODO Refill zone when KiCad supports auto re-fill
|
||||||
|
|
||||||
if( zone->HitTestCutout( curPos, &outlineIdx, &holeIdx ) )
|
// Update the display
|
||||||
{
|
zone->HatchBorder();
|
||||||
// Remove the cutout
|
canvas()->Refresh();
|
||||||
commit.Modify( zone );
|
|
||||||
zone->RemoveCutout( outlineIdx, holeIdx );
|
|
||||||
zone->UnFill();
|
|
||||||
|
|
||||||
// TODO Refill zone when KiCad supports auto re-fill
|
// Restore the selection on the original zone
|
||||||
|
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, zone );
|
||||||
|
|
||||||
// Update the display
|
break;
|
||||||
zone->HatchBorder();
|
|
||||||
canvas()->Refresh();
|
|
||||||
|
|
||||||
// Restore the selection on the original zone
|
|
||||||
m_toolMgr->RunAction<EDA_ITEM*>( PCB_ACTIONS::selectItem, zone );
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the entire zone otherwise
|
|
||||||
commit.Remove( board_item );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove the entire zone otherwise
|
||||||
|
commit.Remove( board_item );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCB_GENERATOR_T:
|
case PCB_GENERATOR_T:
|
||||||
|
|
Loading…
Reference in New Issue