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