mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-31 14:34:40 +00:00
Make drawing code resilient against bad bboxes
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
This commit is contained in:
parent
d269c8596c
commit
f994654918
@ -43,6 +43,11 @@ def draw_clusters(
|
||||
y0 *= scale_x
|
||||
y1 *= scale_y
|
||||
|
||||
if y1 <= y0:
|
||||
y1, y0 = y0, y1
|
||||
if x1 <= x0:
|
||||
x1, x0 = x0, x1
|
||||
|
||||
cluster_fill_color = (*list(DocItemLabel.get_color(c.label)), 70)
|
||||
cluster_outline_color = (
|
||||
*list(DocItemLabel.get_color(c.label)),
|
||||
|
Loading…
Reference in New Issue
Block a user