Gerbview: Fix incorrect rendering of aperture macros combining polygons.
A aperture macro can have polygons with holes, and/or many polygons. When combining polygons holes can be created. So ensure the resulting polygon is fractured before drawing it. From Master branch Fixes #11218 https://gitlab.com/kicad/code/kicad/issues/11218
This commit is contained in:
parent
e14e9cf8a9
commit
375a7303c5
|
@ -814,7 +814,6 @@ SHAPE_POLY_SET* APERTURE_MACRO::GetApertureMacroShape( const GERBER_DRAW_ITEM* a
|
|||
const wxPoint& aShapePos )
|
||||
{
|
||||
SHAPE_POLY_SET holeBuffer;
|
||||
bool hasHole = false;
|
||||
|
||||
m_shape.RemoveAllContours();
|
||||
|
||||
|
@ -836,18 +835,17 @@ SHAPE_POLY_SET* APERTURE_MACRO::GetApertureMacroShape( const GERBER_DRAW_ITEM* a
|
|||
{
|
||||
m_shape.BooleanSubtract( holeBuffer, SHAPE_POLY_SET::PM_FAST );
|
||||
holeBuffer.RemoveAllContours();
|
||||
hasHole = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Merge and cleanup basic shape polygons
|
||||
m_shape.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
|
||||
// If a hole is defined inside a polygon, we must fracture the polygon
|
||||
// to be able to drawn it (i.e link holes by overlapping edges)
|
||||
if( hasHole )
|
||||
m_shape.Fracture( SHAPE_POLY_SET::PM_FAST );
|
||||
// A hole can be is defined inside a polygon, or the polygons themselve can create
|
||||
// a hole when merged, so we must fracture the polygon to be able to drawn it
|
||||
// (i.e link holes by overlapping edges)
|
||||
m_shape.Fracture( SHAPE_POLY_SET::PM_FAST );
|
||||
|
||||
m_boundingBox = EDA_RECT( wxPoint( 0, 0 ), wxSize( 1, 1 ) );
|
||||
auto bb = m_shape.BBox();
|
||||
|
|
Loading…
Reference in New Issue