Fixed the orientation issue with rendering sketch as svg.
The sketches were flipped vertically when displayed as svg. It was due to the defaults in the drawSvg library that was using bottom-left corner as the origin by default. Fixed it by specifying the top-right as the origin.
This commit is contained in:
@@ -37,7 +37,7 @@ def _read_messages(ws):
|
||||
return messages
|
||||
|
||||
def draw_image(commands):
|
||||
img = draw.Drawing(300, 300, fill='none', stroke='black')
|
||||
img = draw.Drawing(300, 300, origin=(0, -300), fill='none', stroke='black')
|
||||
for c in commands:
|
||||
if c['function'] == 'circle':
|
||||
img.append(draw.Circle(cx=c['x'], cy=c['y'], r=c['d']/2))
|
||||
|
||||
Reference in New Issue
Block a user