Fix radius int parameter

pull/1060/head
Piero Toffanin 2021-09-24 17:54:02 -04:00
rodzic 62e42a0a1f
commit 9c32b98d80
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -82,7 +82,7 @@ class Thumbnail(TaskNestedView):
'x': coords[0],
'y': coords[1],
'color': hex2rgb(point_colors[i]) if i < len(point_colors) else (255, 255, 255),
'radius': float(point_radiuses[i]) if i < len(point_radiuses) else 1,
'radius': float(point_radiuses[i]) if i < len(point_radiuses) else 1.0,
})
i += 1
@ -100,8 +100,9 @@ class Thumbnail(TaskNestedView):
for p in points:
d = ImageDraw.Draw(img)
r = p['radius']
d.ellipse([(p['x'] * w - r, p['y'] * h - r),
(p['x'] * w + r, p['y'] * h + r)], outline=p['color'], width=max(1.0, math.floor(r / 3.0)))
(p['x'] * w + r, p['y'] * h + r)], outline=p['color'], width=int(max(1.0, math.floor(r / 3.0))))
# Move image center
if center_x != 0.5 or center_y != 0.5: