This is like Sketchpad.
IFGAJAF7UWM236QV4NWP2C67TJPQGXNBC2RTZCOWPJUJYYC2MMXAC 4NDYV4WDJWOK6PGURVVPNYEZTX7GPJC2YJ2QTW7P3X3BJBTTJLEQC GP56QHRHE3TTUJEUYW32XDPMWODSC5QIYZWDDBTY6NNFQKAVINDQC ZD63LJ2TGWQQ5KWAX22QUWEYI2X5XUI2UTE4E7LGY26AS7HT2WGQC 6F6DF5T3XUD2AEAJT4GBEBZXOVPTGLK5HY36VIW6P6AKAHJQE5UQC XX7G2FFJ4QCGQGD4REAW5QFHVYAKCFUPGZCK7L6DFGS5ISVBYBQQC OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC JCSLDGAH2F6AIY4Z6XM6K4LOMW7EFY3E4NF5YXLMHLTYTX3A4Z3QC G77XIN7MLX465AXLXDUJDGEHXXCMR2Q7K25UAMKQERBJGNJPNW6AC KCIM5UTVV4KIL7SNRZFOW6FUQHGWAPOGQO4QTVNIWWBWMVG6GYNQC EFMLTMZG5TUEGLSYLVKOKDSTGVSVWSKOMS7CJWOUGK5LADSH4YTQC H7OEU6WPOKOSKV5RNAM5W62V5SYOY7VEA5VOK6JD5UEBUBIMOKUQC T76KKDWZLQSWMXT2ZE2PPNKBKB4W5M4BW5E6ICHKEBDAUBN6FMZAC 3XD6M3CFKZJR365MHXUWJ4HGSDTPYO6WYZ4RGW7ECBBITKVQX24QC draw_shape(16,line.y, shape)
draw_shape(16,line.y, line, shape)endfor _,p in ipairs(line.points) doif p.x == mx and p.y == my thenlove.graphics.setColor(1,0,0)elselove.graphics.setColor(0,0,0)endlove.graphics.circle('line', pixels(p.x)+16,pixels(p.y)+line.y, 4)
lines.current.pending.x2 = coord(x-16)lines.current.pending.y2 = coord(y-lines.current.y)
local j = insert_point(lines.current.points, coord(x-16), coord(y-lines.current.y))lines.current.pending.p2 = j
love.graphics.line(pixels(shape.x1)+left,pixels(shape.y1)+top, pixels(shape.x2)+left,pixels(shape.y2)+top)
local p1 = drawing.points[shape.p1]local p2 = drawing.points[shape.p2]love.graphics.line(pixels(p1.x)+left,pixels(p1.y)+top, pixels(p2.x)+left,pixels(p2.y)+top)
function on_line(x,y, shape)if shape.x1 == shape.x2 thenif math.abs(shape.x1-x) > 5 then
function on_line(x,y, drawing, shape)local p1,p2if type(shape.p1) == 'number' thenp1 = drawing.points[shape.p1]p2 = drawing.points[shape.p2]elsep1 = shape.p1p2 = shape.p2endif p1.x == p2.x thenif math.abs(p1.x-x) > 5 then
shape.x1 = shape.points[1].xshape.y1 = shape.points[1].yshape.x2 = shape.points[#shape.points].xshape.y2 = shape.points[#shape.points].y
shape.p1 = insert_point(drawing.points, shape.points[1].x, shape.points[1].y)local n = #shape.pointsshape.p2 = insert_point(drawing.points, shape.points[n].x, shape.points[n].y)