fix some type isssues leading to warnings like:
WARNING: dot code  ... : integer argument expected, got float
@@ -57,7 +57,7 @@ def dashize_line(line, length):
if pt1[1] > pt2[1]:
pt2, pt1 = line
- r = stepslice(range(pt1[1], pt2[1]), length)
+ r = stepslice(range(round(pt1[1]), round(pt2[1])), length)
for y1, y2 in istep(n for n in r):
yield [(pt1[0], y1), (pt1[0], y2)]
@@ -65,7 +65,7 @@ def dashize_line(line, length):
if pt1[0] > pt2[0]:
pt2, pt1 = line
- r = stepslice(range(pt1[0], pt2[0]), length)
+ r = stepslice(range(round(pt1[0]), round(pt2[0])), length)
for x1, x2 in istep(n for n in r):
yield [(x1, pt1[1]), (x2, pt1[1])]
else: # diagonal
@@ -395,9 +395,9 @@ class ImageDrawExBase(base.ImageDraw):
image = image.convert('RGBA')
if image.mode == 'RGBA':
- self.paste(image, (x, y), mask=image)
+ self.paste(image, (round(x), round(y)), mask=image)
else:
- self.paste(image, (x, y))
+ self.paste(image, (round(x), round(y)))
except IOError:
pass
