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