turn strokes into horizontal and vertical lines

[?]
May 12, 2022, 5:33 AM
T76KKDWZLQSWMXT2ZE2PPNKBKB4W5M4BW5E6ICHKEBDAUBN6FMZAC

Dependencies

Change contents

  • edit in main.lua at line 178
    [2.111]
    [2.111]
    end
    elseif chord == 'C-m' then
    local drawing,i,shape = select_shape_at_mouse()
    if drawing then
    convert_horvert(drawing,i,shape)
  • edit in main.lua at line 208
    [5.826]
    [6.325]
    end
    -- turn a stroke into either a horizontal or vertical line
    function convert_horvert(drawing, i, shape)
    local x1,y1 = shape[1].x, shape[1].y
    local x2,y2 = shape[#shape].x, shape[#shape].y
    if math.abs(x1-x2) > math.abs(y1-y2) then
    drawing.shapes[i] = {{x=x1, y=y1}, {x=x2, y=y1}}
    else
    drawing.shapes[i] = {{x=x1, y=y1}, {x=x1, y=y2}}
    end