Skip to content

Commit 4ead30e

Browse files
committed
removed None vs int comparisons
1 parent d9da098 commit 4ead30e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

plotdevice/gfx/bezier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def line(self, x1, y1, x2, y2, ccw=None):
197197
def poly(self, x, y, radius, sides=4, points=None):
198198
# if `points` is defined, draw a regularized star, otherwise draw
199199
# a regular polygon with the given number of `sides`.
200-
if points>4:
200+
if points and points>4:
201201
inner = radius * cos(pi*2/points)/cos(pi/points)
202202
return self.star(x, y, points, inner, radius)
203203
elif points is not None:

plotdevice/gfx/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def _scalefactor(self):
202202
elif all([self.width, self.height]):
203203
factor = min(self.width/src.width, self.height/src.height)
204204
else:
205-
dim, src_dim = max((self.width, src.width), (self.height, src.height))
205+
dim, src_dim = max((self.width or 0, src.width), (self.height or 0, src.height))
206206
factor = dim/src_dim
207207
return factor
208208

0 commit comments

Comments
 (0)