RT6EV6OPUYCXYZOX2PHFXJ7KT77KHNEVINEGQXIQLHQVKPGTN6VQC
6DE7RBZ6RHNEICJ7EUMCTROK43LW4LYINULIF2QEQOKCXWLUYUXAC
3RGHOJ25MCTQ5CRQADFIVJ53QZWRSIQOFGXLFGKQ765QABJ5S54AC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
MNWHXPBL23TOI45LPF7ZECXSURCD2TRLM2EOFNBKFNHIWWKDQWCQC
XX7G2FFJ4QCGQGD4REAW5QFHVYAKCFUPGZCK7L6DFGS5ISVBYBQQC
VHQCNMARPMNBSIUFLJG7HVK4QGDNPCGNVFLHS3I4IGNVSV5MRLYQC
WDWXNW7VH57W6KXBNXFV6NPIO5RUS7Q6QNGGI4R6HWIRXLYI5NSAC
KVHUFUFVOSY6GB4XI2QK4T4WCLIYOV3NZR67TX6AQHAQDWJMEOBQC
BLWAYPKV3MLDZ4ALXLUJ25AIR6PCIL4RFYNRYLB26GFVC2KQBYBAC
if Lines.current == nil then return end
local drawing = Lines.current
assert(drawing.mode == 'drawing')
local x, y = love.mouse.getX(), love.mouse.getY()
if love.mouse.isDown('1') then
if Drawing.in_drawing(drawing, x,y) then
if drawing.pending.mode == 'freehand' then
table.insert(drawing.pending.points, {x=Drawing.coord(love.mouse.getX()-16), y=Drawing.coord(love.mouse.getY()-drawing.y)})
elseif drawing.pending.mode == 'move' then
local mx,my = Drawing.coord(x-16), Drawing.coord(y-drawing.y)
drawing.pending.target_point.x = mx
drawing.pending.target_point.y = my
end
end
elseif Current_drawing_mode == 'move' then
if Drawing.in_drawing(drawing, x, y) then
local mx,my = Drawing.coord(x-16), Drawing.coord(y-drawing.y)
drawing.pending.target_point.x = mx
drawing.pending.target_point.y = my
end
end
Drawing.update(dt)
-- a couple of operations on drawings need to constantly check the state of the mouse
function Drawing.update()
if Lines.current == nil then return end
local drawing = Lines.current
assert(drawing.mode == 'drawing')
local x, y = love.mouse.getX(), love.mouse.getY()
if love.mouse.isDown('1') then
if Drawing.in_drawing(drawing, x,y) then
if drawing.pending.mode == 'freehand' then
table.insert(drawing.pending.points, {x=Drawing.coord(love.mouse.getX()-16), y=Drawing.coord(love.mouse.getY()-drawing.y)})
elseif drawing.pending.mode == 'move' then
local mx,my = Drawing.coord(x-16), Drawing.coord(y-drawing.y)
drawing.pending.target_point.x = mx
drawing.pending.target_point.y = my
end
end
elseif Current_drawing_mode == 'move' then
if Drawing.in_drawing(drawing, x, y) then
local mx,my = Drawing.coord(x-16), Drawing.coord(y-drawing.y)
drawing.pending.target_point.x = mx
drawing.pending.target_point.y = my
end
end
end