insideArea should be outline-based, not fill-based.

Fixes https://gitlab.com/kicad/code/kicad/issues/5499
This commit is contained in:
Jeff Young 2020-09-05 00:24:35 +01:00
parent 3095d0e335
commit 7893af2c60
2 changed files with 4 additions and 11 deletions

View File

@ -185,17 +185,10 @@ static void insideArea( LIBEVAL::CONTEXT* aCtx, void* self )
if( zone )
{
const SHAPE_POLY_SET* zonePoly;
SHAPE_POLY_SET testPoly;
// Do a layer-specific test if we can; otherwise a general outline test
if( zone->GetLayerSet().test( context->GetLayer() ) )
zonePoly = &zone->GetFilledPolysList( context->GetLayer() );
else
zonePoly = zone->Outline();
SHAPE_POLY_SET testPoly;
item->TransformShapeWithClearanceToPolygon( testPoly, context->GetLayer(), 0 );
testPoly.BooleanIntersection( *zonePoly, SHAPE_POLY_SET::PM_FAST );
testPoly.BooleanIntersection( *zone->Outline(), SHAPE_POLY_SET::PM_FAST );
if( testPoly.OutlineCount() )
result->Set( 1.0 );

View File

@ -163,7 +163,7 @@ int ZONE_FILLER_TOOL::ZoneUnfill( const TOOL_EVENT& aEvent )
{
BOARD_COMMIT commit( this );
for( auto item : selection() )
for( EDA_ITEM* item : selection() )
{
assert( item->Type() == PCB_ZONE_AREA_T );
@ -186,7 +186,7 @@ int ZONE_FILLER_TOOL::ZoneUnfillAll( const TOOL_EVENT& aEvent )
{
BOARD_COMMIT commit( this );
for ( auto zone : board()->Zones() )
for( ZONE_CONTAINER* zone : board()->Zones() )
{
commit.Modify( zone );