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)
end
for _,p in ipairs(line.points) do
if p.x == mx and p.y == my then
love.graphics.setColor(1,0,0)
else
love.graphics.setColor(0,0,0)
end
love.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 then
if math.abs(shape.x1-x) > 5 then
function on_line(x,y, drawing, shape)
local p1,p2
if type(shape.p1) == 'number' then
p1 = drawing.points[shape.p1]
p2 = drawing.points[shape.p2]
else
p1 = shape.p1
p2 = shape.p2
end
if p1.x == p2.x then
if math.abs(p1.x-x) > 5 then
shape.x1 = shape.points[1].x
shape.y1 = shape.points[1].y
shape.x2 = shape.points[#shape.points].x
shape.y2 = shape.points[#shape.points].y
shape.p1 = insert_point(drawing.points, shape.points[1].x, shape.points[1].y)
local n = #shape.points
shape.p2 = insert_point(drawing.points, shape.points[n].x, shape.points[n].y)