slightly strange way to move points

[?]
May 15, 2022, 6:11 AM
WDWXNW7VH57W6KXBNXFV6NPIO5RUS7Q6QNGGI4R6HWIRXLYI5NSAC

Dependencies

  • [2] U76D4P36 fix a typo
  • [3] FJ4L6N74 draw lines by default
  • [4] RXE6NQTN changing your mind mid-shape
  • [5] D2GCFTTT clean up repl functionality
  • [6] WAZVXUV2 simplest possible way to straighten strokes
  • [7] T76KKDWZ turn strokes into horizontal and vertical lines
  • [8] 6LJZN727 handle chords
  • [9] O2UFJ6G3 switch from freehand to just straight lines
  • [10] HRWN5V6J Devine's suggestion to try to live with just freehand
  • [11] KCIM5UTV revert: back to freehand
  • [12] H7OEU6WP experimental approach to combining keyboard and mouse while drawing
  • [13] 3XD6M3CF refactor
  • [14] OTIBCAUJ love2d scaffold
  • [15] NL5J7Z5H new mode: polygon
  • [16] ZOOY3ME4 new mode: circle arc
  • [17] IFGAJAF7 add a level of indirection to vertices of shapes
  • [18] FMQ74DP3 new mode: circle
  • [19] JCSLDGAH beginnings of support for multiple shapes
  • [20] HWPK4SMP new mode: manhattan
  • [*] JVRL5TWL store device-independent coordinates inside drawings
  • [*] XX7G2FFJ intermingle freehand line drawings with text
  • [*] KVHUFUFV reorg

Change contents

  • edit in main.lua at line 38
    [3.25]
    [22.3]
    previous_mode = nil
  • edit in main.lua at line 136
    [23.1677]
    [23.1677]
    elseif current_mode == 'move' then
    local drawing = lines.current
    local x, y = love.mouse.getX(), love.mouse.getY()
    if y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 16 and x < 16+drawingw then
    local mx,my = coord(x-16), coord(y-drawing.y)
    drawing.pending.target_point.x = mx
    drawing.pending.target_point.y = my
    end
  • edit in main.lua at line 148
    [24.48]
    [2.3]
    if current_mode == 'move' then
    current_mode = previous_mode
    previous_mode = nil
    return
    end
  • replacement in main.lua at line 466
    [5.1135][5.82:111]()
    elseif chord == 'C-f' then
    [5.1135]
    [5.111]
    elseif chord == 'C-f' and not love.mouse.isDown('1') then
  • replacement in main.lua at line 468
    [5.141][5.1935:1964]()
    elseif chord == 'C-g' then
    [5.141]
    [4.3]
    elseif chord == 'C-g' and not love.mouse.isDown('1') then
  • replacement in main.lua at line 484
    [5.2293][5.1353:1382]()
    elseif chord == 'C-c' then
    [5.2293]
    [5.1382]
    elseif chord == 'C-c' and not love.mouse.isDown('1') then
  • replacement in main.lua at line 529
    [5.1022][5.11:40](),[5.1493][5.11:40](),[5.11][5.11:40]()
    elseif chord == 'C-m' then
    [5.1493]
    [5.1494]
    elseif chord == 'C-m' and not love.mouse.isDown('1') then
  • replacement in main.lua at line 535
    [5.119][5.3:32]()
    elseif chord == 'C-s' then
    [5.119]
    [5.32]
    elseif chord == 'C-s' and not love.mouse.isDown('1') then
  • edit in main.lua at line 540
    [5.482]
    [5.482]
    elseif chord == 'C-v' and not love.mouse.isDown('1') then
    local drawing,p = select_point_at_mouse()
    if drawing then
    previous_mode = current_mode
    current_mode = 'move'
    drawing.pending = {target_point=p}
    lines.current = drawing
    end
  • edit in main.lua at line 585
    [5.542]
    [5.448]
    end
    end
    end
    end
    end
    end
    function select_point_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 + pixels(drawing.h) and x >= 16 and x < 16+drawingw then
    local mx,my = coord(love.mouse.getX()-16), coord(love.mouse.getY()-drawing.y)
    for _,point in ipairs(drawing.points) do
    assert(point)
    if near(point, mx,my) then
    return drawing,point