Skip to content

Commit 640c14e

Browse files
author
Robert Sachunsky
committed
AutoPageSeg/FindBlocks/GridRemoveUnderlinePartitions: avoid self-deletion
When checking horizontal line partitions for possible interpretation as underline formatting, avoid confusing the hline partition itself with an overlapping neighbour (which would delete it).
1 parent 65a077d commit 640c14e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/textord/colfind.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,9 @@ void ColumnFinder::GridRemoveUnderlinePartitions() {
12521252
if (line_box.bottom() <= text_bottom && text_bottom <= search_box.top())
12531253
touched_text = true;
12541254
} else if (covered->blob_type() == BRT_HLINE &&
1255-
line_box.contains(covered->bounding_box())) {
1255+
line_box.contains(covered->bounding_box()) &&
1256+
// not if same instance (identical to hline)
1257+
!TBOX(covered->bounding_box()).contains(line_box)) {
12561258
line_part = covered;
12571259
}
12581260
}

0 commit comments

Comments
 (0)