Skip to content

Commit 60f4479

Browse files
Modified util_make_irect() to capture area more robustly; updates issue #3163
1 parent ff1bdbb commit 60f4479

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
@@ -20311,13 +20311,15 @@ def handle_args():
2031120311

2031220312
def util_make_irect( *args, p0=None, p1=None, x0=None, y0=None, x1=None, y1=None):
2031320313
a, b, c, d = util_make_rect( *args, p0=p0, p1=p1, x0=x0, y0=y0, x1=x1, y1=y1)
20314-
def convert(x):
20315-
ret = int(x)
20316-
return ret
20317-
a = convert(a)
20318-
b = convert(b)
20319-
c = convert(c)
20320-
d = convert(d)
20314+
def convert(x, ceil):
20315+
if ceil:
20316+
return int(math.ceil(x))
20317+
else:
20318+
return int(math.floor(x))
20319+
a = convert(a, False)
20320+
b = convert(b, False)
20321+
c = convert(c, True)
20322+
d = convert(d, True)
2032120323
return a, b, c, d
2032220324

2032320325

0 commit comments

Comments
 (0)