Loosen cells header expansion algorithm
Accept cells if they're at least 50% within the table's bounds.pull/153/head
parent
0be58de1cb
commit
df3d28837d
|
|
@ -60,8 +60,9 @@ def todo_move_me_expand_area_for_header(area, textlines, col_anchors,
|
||||||
closest_above = None
|
closest_above = None
|
||||||
all_above = []
|
all_above = []
|
||||||
for te in textlines:
|
for te in textlines:
|
||||||
# higher than the table, directly within its bounds
|
# higher than the table, >50% within its bounds
|
||||||
if te.y0 > top and te.x0 >= left and te.x1 <= right:
|
te_center = 0.5 * (te.x0 + te.x1)
|
||||||
|
if te.y0 > top and left < te_center < right:
|
||||||
all_above.append(te)
|
all_above.append(te)
|
||||||
if closest_above is None or closest_above.y0 > te.y0:
|
if closest_above is None or closest_above.y0 > te.y0:
|
||||||
closest_above = te
|
closest_above = te
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue