refactor

[?]
May 12, 2022, 5:29 AM
3XD6M3CFKZJR365MHXUWJ4HGSDTPYO6WYZ4RGW7ECBBITKVQX24QC

Dependencies

  • [2] WAZVXUV2 simplest possible way to straighten strokes
  • [3] D2GCFTTT clean up repl functionality
  • [4] OTIBCAUJ love2d scaffold

Change contents

  • replacement in main.lua at line 175
    [2.32][2.32:448]()
    for i,drawing in ipairs(lines) do
    if type(drawing) == 'table' then
    local 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 then
    for j,shape in ipairs(drawing.shapes) do
    if on_freehand(love.mouse.getX(),love.mouse.getY(), shape) then
    convert_line(drawing,j,shape)
    end
    [2.32]
    [2.448]
    local drawing,i,shape = select_shape_at_mouse()
    if drawing then
    convert_line(drawing,i,shape)
    end
    end
    end
    function select_shape_at_mouse()
    for _,drawing in ipairs(lines) do
    if type(drawing) == 'table' then
    local 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 then
    for i,shape in ipairs(drawing.shapes) do
    if on_freehand(love.mouse.getX(),love.mouse.getY(), shape) then
    return drawing,i,shape