Make sure a pad is at least as big as its hole in the RTree.

Fixes https://gitlab.com/kicad/code/kicad/issues/9516
This commit is contained in:
Jeff Young 2021-11-03 18:52:41 +00:00
parent 2b5ea7812f
commit ffd1139cfe
1 changed files with 13 additions and 0 deletions

View File

@ -27,6 +27,7 @@
#include <eda_rect.h>
#include <board_item.h>
#include <pad.h>
#include <fp_text.h>
#include <memory>
#include <unordered_set>
@ -35,6 +36,7 @@
#include <geometry/rtree.h>
#include <geometry/shape.h>
#include <geometry/shape_segment.h>
#include <math/vector2d.h>
/**
@ -99,6 +101,17 @@ public:
else
subshapes.push_back( shape.get() );
if( aItem->Type() == PCB_PAD_T )
{
PAD* pad = static_cast<PAD*>( aItem );
if( pad->GetDrillSizeX() )
{
const SHAPE* hole = pad->GetEffectiveHoleShape();
subshapes.push_back( const_cast<SHAPE*>( hole ) );
}
}
for( SHAPE* subshape : subshapes )
{
BOX2I bbox = subshape->BBox();