diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index cc6300aa7c..eac407ad6a 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -160,7 +160,8 @@ static std::shared_ptr makeShapeModificationMenu( TOOL_INTERAC static const std::vector lineExtendTypes = { PCB_SHAPE_LOCATE_SEGMENT_T }; static const std::vector polygonBooleanTypes = { PCB_SHAPE_LOCATE_RECT_T, - PCB_SHAPE_LOCATE_POLY_T }; + PCB_SHAPE_LOCATE_POLY_T, + PCB_SHAPE_LOCATE_CIRCLE_T }; static const std::vector polygonSimplifyTypes = { PCB_SHAPE_LOCATE_POLY_T, PCB_ZONE_T }; @@ -1829,7 +1830,13 @@ int EDIT_TOOL::BooleanPolygons( const TOOL_EVENT& aEvent ) { BOARD_ITEM* item = aCollector[i]; - if( !item->IsType( { PCB_SHAPE_LOCATE_POLY_T, PCB_SHAPE_LOCATE_RECT_T } ) ) + static const std::vector polygonBooleanTypes = { + PCB_SHAPE_LOCATE_POLY_T, + PCB_SHAPE_LOCATE_RECT_T, + PCB_SHAPE_LOCATE_CIRCLE_T, + }; + + if( !item->IsType( polygonBooleanTypes ) ) aCollector.Remove( item ); } }, diff --git a/pcbnew/tools/item_modification_routine.cpp b/pcbnew/tools/item_modification_routine.cpp index 73bae6e4d1..d9a12b9515 100644 --- a/pcbnew/tools/item_modification_routine.cpp +++ b/pcbnew/tools/item_modification_routine.cpp @@ -454,18 +454,26 @@ void POLYGON_BOOLEAN_ROUTINE::ProcessShape( PCB_SHAPE& aPcbShape ) } case SHAPE_T::RECTANGLE: { - SHAPE_POLY_SET rect_poly; + poly = std::make_unique(); const std::vector rect_pts = aPcbShape.GetRectCorners(); - rect_poly.NewOutline(); + poly->NewOutline(); for( const VECTOR2I& pt : rect_pts ) { - rect_poly.Append( pt ); + poly->Append( pt ); } + break; + } + case SHAPE_T::CIRCLE: + { + poly = std::make_unique(); + const SHAPE_ARC arc{ aPcbShape.GetCenter(), aPcbShape.GetCenter() + VECTOR2I{ aPcbShape.GetRadius(), 0 }, + FULL_CIRCLE, 0 }; - poly = std::make_unique( std::move( rect_poly ) ); + poly->NewOutline(); + poly->Append( arc ); break; } default: