Allow on-outline zones to be considered inside

Also ensure that calculated areas for island removal are absolute.

The on-outline zone can happen when the clearance to the edge is
particularly small.

Fixes https://gitlab.com/kicad/code/kicad/issues/13717
This commit is contained in:
Seth Hillbrand 2023-01-31 12:28:19 -08:00
parent 29a4e2c7fe
commit f34aa947d3
1 changed files with 3 additions and 3 deletions

View File

@ -525,7 +525,7 @@ bool ZONE_FILLER::Fill( std::vector<ZONE*>& aZones, bool aCheck, wxWindow* aPare
if( mode == ISLAND_REMOVAL_MODE::ALWAYS )
poly->DeletePolygonAndTriangulationData( idx, false );
else if ( mode == ISLAND_REMOVAL_MODE::AREA && outline.Area() < minArea )
else if ( mode == ISLAND_REMOVAL_MODE::AREA && outline.Area( true ) < minArea )
poly->DeletePolygonAndTriangulationData( idx, false );
else
zone.m_zone->SetIsIsland( layer, idx );
@ -563,8 +563,8 @@ bool ZONE_FILLER::Fill( std::vector<ZONE*>& aZones, bool aCheck, wxWindow* aPare
std::vector<SHAPE_LINE_CHAIN>& island = poly->Polygon( ii );
if( island.empty()
|| !m_boardOutline.Contains( island.front().CPoint( 0 ) )
|| island.front().Area() < minArea )
|| !m_boardOutline.Contains( island.front().CPoint( 0 ), -1, 1 )
|| island.front().Area( true ) < minArea )
{
poly->DeletePolygonAndTriangulationData( ii, false );
}