mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-01 15:02:21 +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
|
y0 *= scale_x
|
||||||
y1 *= scale_y
|
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_fill_color = (*list(DocItemLabel.get_color(c.label)), 70)
|
||||||
cluster_outline_color = (
|
cluster_outline_color = (
|
||||||
*list(DocItemLabel.get_color(c.label)),
|
*list(DocItemLabel.get_color(c.label)),
|
||||||
|
Loading…
Reference in New Issue
Block a user