From 9c485dbd4e028fca2b44b945aad0e9a335da9f3d Mon Sep 17 00:00:00 2001 From: Anand Chitipothu Date: Wed, 17 Mar 2021 11:40:04 +0000 Subject: [PATCH] Added support for line and rect in the preview of sketches --- community/lms/doctype/lms_sketch/livecode.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/community/lms/doctype/lms_sketch/livecode.py b/community/lms/doctype/lms_sketch/livecode.py index 1eb804ad..4363efc7 100644 --- a/community/lms/doctype/lms_sketch/livecode.py +++ b/community/lms/doctype/lms_sketch/livecode.py @@ -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