move

[?]
May 17, 2022, 5:28 AM
ZUOL7X6VIPRCMEZURYGNHTDEIP3ZCHZW4PKVKBNXVZL5V4VOE5ZQC

Dependencies

  • [2] LBQAAJN4 load/save freehand strokes
  • [3] VVXVV2D2 change data model; text can now have metadata
  • [4] O2UFJ6G3 switch from freehand to just straight lines
  • [5] IFGAJAF7 add a level of indirection to vertices of shapes
  • [6] YKRF5V3Z starting to load/save
  • [7] JCSLDGAH beginnings of support for multiple shapes
  • [8] S5JIPJPI .
  • [9] WDWXNW7V slightly strange way to move points
  • [10] 6PUNJS5B backspace
  • [11] EFMLTMZG bugfix: restrict strokes to the drawing they started in
  • [12] G77XIN7M selecting a stroke
  • [13] NL5J7Z5H new mode: polygon
  • [14] FMQ74DP3 new mode: circle
  • [15] KVHUFUFV reorg
  • [16] OTIBCAUJ love2d scaffold
  • [17] JVRL5TWL store device-independent coordinates inside drawings
  • [18] ZD63LJ2T bugfix: keep the click to create a new drawing from creating a new shape in the drawing
  • [19] U76D4P36 fix a typo
  • [20] KCIM5UTV revert: back to freehand
  • [21] MNWHXPBL more lightweight; select just the stroke at the mouse
  • [22] 6LJZN727 handle chords
  • [23] HWPK4SMP new mode: manhattan
  • [24] XX7G2FFJ intermingle freehand line drawings with text
  • [25] OFA3PRBS autosave on keystrokes

Change contents

  • replacement in main.lua at line 199
    [4.47][4.105:142](),[4.91][4.105:142]()
    propagate_to_drawings(x,y, button)
    [4.47]
    [4.446]
    for i,drawing in ipairs(lines) do
    if drawing.mode == 'drawing' 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
    if current_mode == 'freehand' then
    drawing.pending = {mode=current_mode, points={{x=coord(x-16), y=coord(y-drawing.y)}}}
    elseif current_mode == 'line' or current_mode == 'manhattan' then
    local j = insert_point(drawing.points, coord(x-16), coord(y-drawing.y))
    drawing.pending = {mode=current_mode, p1=j}
    elseif current_mode == 'polygon' then
    local j = insert_point(drawing.points, coord(x-16), coord(y-drawing.y))
    drawing.pending = {mode=current_mode, vertices={j}}
    elseif current_mode == 'circle' then
    local j = insert_point(drawing.points, coord(x-16), coord(y-drawing.y))
    drawing.pending = {mode=current_mode, center=j}
    end
    lines.current = drawing
    end
    end
    end
  • edit in main.lua at line 284
    [4.2114][4.143:187](),[4.451][4.143:187](),[4.220][4.187:223](),[4.187][4.187:223](),[4.223][3.781:819](),[3.819][4.260:316](),[4.260][4.260:316](),[4.316][4.520:619](),[4.619][4.2115:2158](),[4.1168][4.2115:2158](),[4.2158][2.3:99](),[2.99][4.621:695](),[4.97][4.621:695](),[4.695][4.631:713](),[4.2293][4.631:713](),[4.713][4.98:152](),[4.152][4.404:594](),[4.594][4.428:613](),[4.152][4.2374:2386](),[4.594][4.2374:2386](),[4.613][4.2374:2386](),[4.761][4.2374:2386](),[4.794][4.2374:2386](),[4.2374][4.2374:2386](),[4.725][4.408:440](),[4.1168][4.408:440](),[4.2386][4.408:440](),[4.408][4.408:440](),[4.391][4.440:464](),[4.440][4.440:464](),[4.408][4.464:469](),[4.464][4.464:469]()
    function propagate_to_drawings(x,y, button)
    for i,drawing in ipairs(lines) do
    if drawing.mode == 'drawing' 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
    if current_mode == 'freehand' then
    drawing.pending = {mode=current_mode, points={{x=coord(x-16), y=coord(y-drawing.y)}}}
    elseif current_mode == 'line' or current_mode == 'manhattan' then
    local j = insert_point(drawing.points, coord(x-16), coord(y-drawing.y))
    drawing.pending = {mode=current_mode, p1=j}
    elseif current_mode == 'polygon' then
    local j = insert_point(drawing.points, coord(x-16), coord(y-drawing.y))
    drawing.pending = {mode=current_mode, vertices={j}}
    elseif current_mode == 'circle' then
    local j = insert_point(drawing.points, coord(x-16), coord(y-drawing.y))
    drawing.pending = {mode=current_mode, center=j}
    end
    lines.current = drawing
    end
    end
    end
    end