refactor
[?]
May 12, 2022, 5:29 AM
3XD6M3CFKZJR365MHXUWJ4HGSDTPYO6WYZ4RGW7ECBBITKVQX24QCDependencies
- [2]
WAZVXUV2simplest possible way to straighten strokes - [3]
D2GCFTTTclean up repl functionality - [4]
OTIBCAUJlove2d scaffold
Change contents
- replacement in main.lua at line 175
for i,drawing in ipairs(lines) doif type(drawing) == 'table' thenlocal x, y = love.mouse.getX(), love.mouse.getY()if y >= drawing.y and y < drawing.y + drawing.h and x >= 12 and x < 12+drawing.w thenfor j,shape in ipairs(drawing.shapes) doif on_freehand(love.mouse.getX(),love.mouse.getY(), shape) thenconvert_line(drawing,j,shape)endlocal drawing,i,shape = select_shape_at_mouse()if drawing thenconvert_line(drawing,i,shape)endendendfunction select_shape_at_mouse()for _,drawing in ipairs(lines) doif type(drawing) == 'table' thenlocal x, y = love.mouse.getX(), love.mouse.getY()if y >= drawing.y and y < drawing.y + drawing.h and x >= 12 and x < 12+drawing.w thenfor i,shape in ipairs(drawing.shapes) doif on_freehand(love.mouse.getX(),love.mouse.getY(), shape) thenreturn drawing,i,shape