fix line ends on draw_polygons_contours_line.

This commit is contained in:
Bruno Madeira
2025-10-01 10:50:55 +01:00
parent ab16bd4c0e
commit 53f7c64a04
+2 -1
View File
@@ -132,7 +132,8 @@ def draw_polygons_contours_line(
scaled_width = round(stroke_width * upscale)
def draw_func(draw: ImageDraw, points: list):
draw.line(points + [points[0]], fill=stroke_color, width=scaled_width, joint="curve")
extend_end = max(2, math.ceil(len(points)/4)) # ensure the last corner is properly drawn
draw.line(points + points[0:extend_end], fill=stroke_color, width=scaled_width, joint="curve")
return _draw_polygons_contours(draw_func, polys, canvas, upscale)