about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-05-30 00:16:18 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-05-30 00:16:18 -0700
commit7ef5f1e0bbca4b0500acdaf32b83a16babf9c450 (patch)
tree025f41199c927fb0ae6377c59feb1d2ac636f290
parentb071ba51a3aa5cee8830425ed8d52db5096559f9 (diff)
parent7c5a99f105367b68a61dfd89efb458e598d229e9 (diff)
downloadview.love-7ef5f1e0bbca4b0500acdaf32b83a16babf9c450.tar.gz
Merge text.love
-rw-r--r--source_file.lua15
1 files changed, 10 insertions, 5 deletions
diff --git a/source_file.lua b/source_file.lua
index 3adab1f..3eaf6c3 100644
--- a/source_file.lua
+++ b/source_file.lua
@@ -93,21 +93,26 @@ function store_drawing(outfile, drawing)
   outfile:write('```lines\n')
   for _,shape in ipairs(drawing.shapes) do
     if shape.mode == 'freehand' then
-      outfile:write(json.encode(shape), '\n')
+      outfile:write(json.encode(shape))
+      outfile:write('\n')
     elseif shape.mode == 'line' or shape.mode == 'manhattan' then
       local line = json.encode({mode=shape.mode, p1=drawing.points[shape.p1], p2=drawing.points[shape.p2]})
-      outfile:write(line, '\n')
+      outfile:write(line)
+      outfile:write('\n')
     elseif shape.mode == 'polygon' or shape.mode == 'rectangle' or shape.mode == 'square' then
       local obj = {mode=shape.mode, vertices={}}
       for _,p in ipairs(shape.vertices) do
         table.insert(obj.vertices, drawing.points[p])
       end
       local line = json.encode(obj)
-      outfile:write(line, '\n')
+      outfile:write(line)
+      outfile:write('\n')
     elseif shape.mode == 'circle' then
-      outfile:write(json.encode({mode=shape.mode, center=drawing.points[shape.center], radius=shape.radius}), '\n')
+      outfile:write(json.encode({mode=shape.mode, center=drawing.points[shape.center], radius=shape.radius}))
+      outfile:write('\n')
     elseif shape.mode == 'arc' then
-      outfile:write(json.encode({mode=shape.mode, center=drawing.points[shape.center], radius=shape.radius, start_angle=shape.start_angle, end_angle=shape.end_angle}), '\n')
+      outfile:write(json.encode({mode=shape.mode, center=drawing.points[shape.center], radius=shape.radius, start_angle=shape.start_angle, end_angle=shape.end_angle}))
+      outfile:write('\n')
     elseif shape.mode == 'deleted' then
       -- ignore
     else