From 18b6bdf5dd8ec6f9b2c7bbc65dd9c7322b84e7af Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 23 Aug 2019 10:36:44 -0700 Subject: [PATCH] Use cached bbox for connectivity On large boards, connectivity checks are hotspots. We use the cached bbox to avoid re-computing polygons for pads. --- pcbnew/connectivity/connectivity_items.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pcbnew/connectivity/connectivity_items.cpp b/pcbnew/connectivity/connectivity_items.cpp index 01bc6f105b..b84fcab8b1 100644 --- a/pcbnew/connectivity/connectivity_items.cpp +++ b/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() )