Added support for line and rect in the preview of sketches
This commit is contained in:
@@ -41,4 +41,8 @@ def draw_image(commands):
|
||||
for c in commands:
|
||||
if c['function'] == 'circle':
|
||||
img.append(draw.Circle(cx=c['x'], cy=c['y'], r=c['d']/2))
|
||||
elif c['function'] == 'line':
|
||||
img.append(draw.Line(x1=c['x1'], y1=c['y1'], x2=c['x2'], y2=c['y2']))
|
||||
elif c['function'] == 'rect':
|
||||
img.append(draw.Rectangle(x=c['x'], y=c['y'], width=c['w'], height=c['h']))
|
||||
return img
|
||||
|
||||
Reference in New Issue
Block a user