From 3755661196cb42f55d263a329ff79730c37ea423 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 26 Oct 2020 13:01:04 -0400 Subject: [PATCH] Changed the behavior of searches for labels in the basic extraction such that it looks for material connecting to the label at the center point of the label and not the lower left corner. This keeps the behavior of looking for tiles on the corners of a degenerate label line or point between layers, but avoids problems with sticky labels that are not quite aligned with the rectangle (due to certain commercial EDA tools that have a sloppier notion of labeling). --- extract/ExtRegion.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/extract/ExtRegion.c b/extract/ExtRegion.c index 0843b7a0..658d272c 100644 --- a/extract/ExtRegion.c +++ b/extract/ExtRegion.c @@ -218,13 +218,14 @@ ExtLabelRegions(def, connTo, nodeList, clipArea) for (quad = 0; quad < 4; quad++) { /* - * Visit each of the four quadrants surrounding - * the lower-left corner of the label, searching - * for a tile whose type matches that of the label - * or connects to it. + * Visit each of the four quadrants surrounding the center + * point of the label, searching for a tile whose type matches + * that of the label or connects to it. */ - p.p_x = lab->lab_rect.r_xbot + offsets[quad].p_x; - p.p_y = lab->lab_rect.r_ybot + offsets[quad].p_y; + p.p_x = ((lab->lab_rect.r_xbot + lab->lab_rect.r_xtop) >> 1) + + offsets[quad].p_x; + p.p_y = ((lab->lab_rect.r_ybot + lab->lab_rect.r_ytop) >> 1) + + offsets[quad].p_y; tp = def->cd_planes[pNum]->pl_hint; GOTOPOINT(tp, &p); def->cd_planes[pNum]->pl_hint = tp;