Browse Source

Use cached bbox for connectivity

On large boards, connectivity checks are hotspots.  We use the cached
bbox to avoid re-computing polygons for pads.
pull/15/head
Seth Hillbrand 6 years ago
parent
commit
18b6bdf5dd
  1. 11
      pcbnew/connectivity/connectivity_items.cpp

11
pcbnew/connectivity/connectivity_items.cpp

@ -61,16 +61,15 @@ const VECTOR2I CN_ITEM::GetAnchor( int n ) const
if( n == 0 )
return pt0;
EDA_RECT bbox = pad->GetBoundingBox();
VECTOR2I pt1 = pt0;
switch( n )
{
case 1: pt1.y = bbox.GetTop(); break; // North
case 2: pt1.y = bbox.GetBottom(); break; // South
case 3: pt1.x = bbox.GetLeft(); break; // East
case 4: pt1.x = bbox.GetRight(); break; // West
default: break; // Wicked witch
case 1: pt1.y = m_bbox.GetTop(); break; // North
case 2: pt1.y = m_bbox.GetBottom(); break; // South
case 3: pt1.x = m_bbox.GetLeft(); break; // East
case 4: pt1.x = m_bbox.GetRight(); break; // West
default: break; // Wicked witch
}
switch( pad->GetShape() )

Loading…
Cancel
Save