Use footprintRect not ViewBBox for determining footprint bounds.

This commit is contained in:
Jeff Young 2020-12-05 18:03:19 +00:00
parent d43eefbad5
commit d6c3c6f7fa
1 changed files with 2 additions and 4 deletions

View File

@ -2261,16 +2261,14 @@ int SELECTION_TOOL::hitTestDistance( const wxPoint& aWhere, BOARD_ITEM* aItem,
case PCB_FOOTPRINT_T:
{
FOOTPRINT* footprint = static_cast<FOOTPRINT*>( aItem );
EDA_RECT bbox = footprint->GetFootprintRect();
footprint->GetBoundingHull().Collide( loc, aMaxDistance, &distance );
// Consider footprints larger than the viewport only as a last resort
if( aItem->ViewBBox().GetHeight() > viewport.GetHeight()
|| aItem->ViewBBox().GetWidth() > viewport.GetWidth() )
{
if( bbox.GetHeight() > viewport.GetHeight() || bbox.GetWidth() > viewport.GetWidth() )
distance = INT_MAX / 2;
}
}
break;
case PCB_MARKER_T: