Skip to content

Commit c34ac48

Browse files
psambit9791JorjMcKie
authored andcommitted
Modified util_make_irect() to capture area more robustly; updates issue pymupdf#3163
1 parent d84be3b commit c34ac48

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/__init__.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20490,13 +20490,15 @@ def handle_args():
2049020490

2049120491
def util_make_irect( *args, p0=None, p1=None, x0=None, y0=None, x1=None, y1=None):
2049220492
a, b, c, d = util_make_rect( *args, p0=p0, p1=p1, x0=x0, y0=y0, x1=x1, y1=y1)
20493-
def convert(x):
20494-
ret = int(x)
20495-
return ret
20496-
a = convert(a)
20497-
b = convert(b)
20498-
c = convert(c)
20499-
d = convert(d)
20493+
def convert(x, ceil):
20494+
if ceil:
20495+
return int(math.ceil(x))
20496+
else:
20497+
return int(math.floor(x))
20498+
a = convert(a, False)
20499+
b = convert(b, False)
20500+
c = convert(c, True)
20501+
d = convert(d, True)
2050020502
return a, b, c, d
2050120503

2050220504

0 commit comments

Comments
 (0)