Corrected an issue where code expected sticky labels to be at the

front of the list during extraction, except that after copying
they're not.  Removed the expectation, although that causes the
entire linked list of labels to be parsed and may cause excessive
run-times in pathological situations.  Keep an eye out for
unintended consequences.
This commit is contained in:
Tim Edwards
2023-08-01 13:59:46 -04:00
parent 96ea4aa2fb
commit 952b20d2a2
3 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
8.3.420
8.3.421
+7 -3
View File
@@ -390,9 +390,13 @@ extHierConnectFunc1(oneTile, ha)
for (lab = cumDef->cd_labels; lab; lab = lab->lab_next)
{
// All sticky labels are at the front of the list in cumDef, so
// stop when we see the first non-sticky label.
if (!(lab->lab_flags & LABEL_STICKY)) break;
/* NOTE: Need a better way to access the sticky labels
* without running through the whole linked list. Pushing
* them to the list front may not work for reasons explained
* in extSubtreeAdjustInit().
*/
if (!(lab->lab_flags & LABEL_STICKY)) continue;
if (GEO_TOUCH(&r, &lab->lab_rect))
if (TTMaskHasType(connected, lab->lab_type))
+1 -1
View File
@@ -821,10 +821,10 @@ extSubtreeFunc(scx, ha)
for (lab = cumDef->cd_labels; lab; lab = lab->lab_next)
{
if (!(lab->lab_flags & LABEL_STICKY)) continue;
if (!(GEO_LABEL_IN_AREA(&lab->lab_rect, &ha->ha_interArea))) continue;
r = lab->lab_rect;
GEOCLIP(&r, &ha->ha_interArea);
if (GEO_RECTNULL(&r)) continue;
if (r.r_xbot == r.r_xtop)
{