up/down cursor movement

[?]
May 17, 2022, 3:26 AM
3CS5KKCIZQ6J4SBILINYZSOM6V3U2LE7YIXOZVKXXNBROF6Z6JWAC

Dependencies

  • [2] VQFBNHU4 make point near focus 'pop'
  • [3] IYW7X3WL left/right cursor movement, deleting characters
  • [4] KCIM5UTV revert: back to freehand
  • [5] ZD63LJ2T bugfix: keep the click to create a new drawing from creating a new shape in the drawing
  • [6] JCSLDGAH beginnings of support for multiple shapes
  • [7] 7RN3AETY bugfix: text sometimes getting colored like drawing borders
  • [8] OFA3PRBS autosave on keystrokes
  • [9] 5TIFKJ7S handle space key
  • [10] QU7NHFOV show cursor
  • [11] 6LJZN727 handle chords
  • [12] OTIBCAUJ love2d scaffold
  • [13] O2UFJ6G3 switch from freehand to just straight lines
  • [14] G77XIN7M selecting a stroke
  • [15] VXORMHME delete experimental REPL
  • [16] NCRKBTHC position cursor more precisely
  • [17] 6PUNJS5B backspace
  • [18] IFGAJAF7 add a level of indirection to vertices of shapes
  • [19] XX7G2FFJ intermingle freehand line drawings with text

Change contents

  • edit in main.lua at line 153
    [4.1053][2.159:189]()
    --? print(#line.points)
  • edit in main.lua at line 157
    [4.1294]
    [4.1294]
    if i == cursor_line then
    -- cursor
    love.graphics.setColor(0,0,0)
    local line_before_cursor = lines[cursor_line]:sub(1, cursor_pos-1)
    local text_before_cursor = love.graphics.newText(love.graphics.getFont(), line_before_cursor)
    love.graphics.print('_', 25+text_before_cursor:getWidth()*1.5, y+6) -- drop the cursor down a bit to account for the increased font size
    end
  • edit in main.lua at line 166
    [4.416][4.120:132](),[4.132][4.39:71](),[4.71][3.184:489]()
    -- cursor
    love.graphics.setColor(0,0,0)
    local line_before_cursor = lines[cursor_line]:sub(1, cursor_pos-1)
    local text_before_cursor = love.graphics.newText(love.graphics.getFont(), line_before_cursor)
    love.graphics.print('_', 25+text_before_cursor:getWidth()*1.5, y+6) -- drop the cursor down a bit to account for the increased font size
  • replacement in main.lua at line 513
    [4.224][4.527:555](),[4.527][4.527:555]()
    table.insert(lines, '')
    [4.224]
    [4.31]
    table.insert(lines, cursor_line+1, '')
    cursor_line = cursor_line+1
    cursor_pos = 1
  • edit in main.lua at line 542
    [3.1510]
    [3.1510]
    end
    elseif chord == 'up' then
    if cursor_line > 1 then
    cursor_line = cursor_line-1
    if cursor_pos > #lines[cursor_line] then
    cursor_pos = #lines[cursor_line]+1
    end
  • edit in main.lua at line 550
    [3.1518]
    [3.1518]
    elseif chord == 'down' then
    if cursor_line < #lines then
    cursor_line = cursor_line+1
    if cursor_pos > #lines[cursor_line] then
    cursor_pos = #lines[cursor_line]+1
    end
    end