diff --git a/pcbnew/tools/zone_create_helper.cpp b/pcbnew/tools/zone_create_helper.cpp index 0f9c2f2adf..05668e6e5d 100644 --- a/pcbnew/tools/zone_create_helper.cpp +++ b/pcbnew/tools/zone_create_helper.cpp @@ -117,7 +117,6 @@ void ZONE_CREATE_HELPER::performZoneCutout( ZONE_CONTAINER& aZone, ZONE_CONTAINE std::vector newZones; SHAPE_POLY_SET originalOutline( *aZone.Outline() ); - originalOutline.BooleanSubtract( *aCutout.Outline(), SHAPE_POLY_SET::PM_FAST ); for( int i = 0; i < originalOutline.OutlineCount(); i++ ) @@ -125,6 +124,11 @@ void ZONE_CREATE_HELPER::performZoneCutout( ZONE_CONTAINER& aZone, ZONE_CONTAINE auto newZoneOutline = new SHAPE_POLY_SET; newZoneOutline->AddOutline( originalOutline.Outline( i ) ); + for (int j = 0; j < originalOutline.HoleCount(i) ; j++ ) + { + newZoneOutline->AddHole( originalOutline.CHole(i, j), i ); + } + auto newZone = new ZONE_CONTAINER( aZone ); newZone->SetOutline( newZoneOutline ); newZone->SetLocalFlags( 1 ); @@ -138,6 +142,11 @@ void ZONE_CREATE_HELPER::performZoneCutout( ZONE_CONTAINER& aZone, ZONE_CONTAINE ZONE_FILLER filler( board ); filler.Fill( newZones ); + + auto toolMgr = m_tool.GetManager(); + + toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); + toolMgr->RunAction( PCB_ACTIONS::selectItem, true, newZones[0] ); }