scroll past first page

[?]
May 19, 2022, 12:22 AM
DLQMM2656JHXX3ONOEM6UIOXKFJFT5QT7RHWK7YS2W77PVZWHRSAC

Dependencies

  • [2] HYEAFRZ2 split mouse_pressed events between Text and Drawing
  • [3] 252M2QMD forgot to move this special case out
  • [4] MGOQ5XAV start uppercasing globals
  • [5] JVRL5TWL store device-independent coordinates inside drawings
  • [6] K6HMLFLZ color close to drawing
  • [7] VVXVV2D2 change data model; text can now have metadata
  • [8] OTIBCAUJ love2d scaffold
  • [9] VQFBNHU4 make point near focus 'pop'
  • [10] 2FMZNSD7 experiment: only show drawing borders when they can be edited
  • [11] R3WSFYGY spacing
  • [12] BULPIBEG beginnings of a module for the text editor
  • [13] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [14] BLWAYPKV extract a module
  • [15] AVQ5MC5D finish uppercasing all globals
  • [16] 6F6DF5T3 .
  • [17] 4NDYV4WD fix 2 bugs in line selection
  • [18] ZD63LJ2T bugfix: keep the click to create a new drawing from creating a new shape in the drawing
  • [19] VHQCNMAR several more modules
  • [20] HDCVGN6G save each line's y coordinate, whether it's a drawing or not
  • [21] 3SYFA5JQ show cursor even on empty lines
  • [22] HJ3PM2VT .
  • [23] V5TP27FP ctrl-+ and ctrl-- to adjust font size
  • [24] 7IKRRESB longer names for indices in long loops
  • [25] XX7G2FFJ intermingle freehand line drawings with text
  • [26] O2UFJ6G3 switch from freehand to just straight lines
  • [27] QU7NHFOV show cursor
  • [28] KCIM5UTV revert: back to freehand
  • [29] JCSLDGAH beginnings of support for multiple shapes
  • [30] 7RN3AETY bugfix: text sometimes getting colored like drawing borders
  • [31] IFGAJAF7 add a level of indirection to vertices of shapes
  • [32] XJ5J7LDI start imposing some organization
  • [*] XNFTJHC4 split keyboard handling between Text and Drawing

Change contents

  • edit in text.lua at line 52
    [34.1443]
    [34.1443]
    end
    if Cursor_line < Screen_top_line then
    Screen_top_line = Cursor_line
  • edit in text.lua at line 71
    [34.1916]
    [34.1916]
    if Cursor_line > Screen_bottom_line then
    Screen_top_line = Cursor_line
    end
  • edit in text.lua at line 137
    [34.4433]
    [34.4433]
    if Cursor_line < Screen_top_line then
    Screen_top_line = Cursor_line
    end
  • edit in text.lua at line 151
    [34.4909]
    [34.4909]
    end
    if Cursor_line > Screen_bottom_line then
    Screen_top_line = Cursor_line
  • edit in text.lua at line 159
    [2.39]
    [2.39]
    if line.y == nil then return false end -- outside current page
  • edit in main.lua at line 39
    [4.35]
    [4.2]
    Screen_top_line = 1
    Screen_bottom_line = 1
  • edit in main.lua at line 104
    [4.336]
    [4.44]
    for line_index,line in ipairs(Lines) do
    line.y = nil
    end
  • replacement in main.lua at line 109
    [4.44][4.933:951](),[4.245][4.933:951](),[4.32][4.1:16](),[4.951][4.1:16](),[4.72][4.1:16](),[4.16][4.265:317](),[4.72][4.265:317](),[4.317][4.96:155](),[4.96][4.96:155](),[4.155][4.1:37](),[4.37][4.470:500](),[4.470][4.470:500](),[4.500][4.45:219](),[4.219][4.998:1049](),[4.998][4.998:1049](),[4.1049][4.666:691](),[4.666][4.666:691](),[4.86][4.588:613](),[4.97][4.588:613](),[4.398][4.588:613](),[4.428][4.588:613](),[4.691][4.588:613](),[4.588][4.588:613](),[4.613][4.220:262](),[4.262][4.34:200](),[4.1083][4.34:200](),[4.34][4.34:200](),[4.200][4.429:468](),[4.468][4.138:173](),[4.173][4.66:94](),[4.426][4.66:94](),[4.94][4.1240:1249](),[4.248][4.1240:1249](),[4.500][4.1240:1249](),[4.1396][4.1240:1249](),[4.1240][4.1240:1249](),[4.1249][4.1515:1577]()
    y = y+15*Zoom
    line.y = y
    if line.mode == 'text' and line.data == '' then
    button('draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},
    icon = icon.insert_drawing,
    onpress1 = function()
    table.insert(Lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})
    if Cursor_line >= line_index then
    Cursor_line = Cursor_line+1
    end
    end})
    if line_index == Cursor_line then
    love.graphics.setColor(0,0,0)
    love.graphics.print('_', 25, y+6) -- drop the cursor down a bit to account for the increased font size
    end
    elseif line.mode == 'drawing' then
    y = y+Drawing.pixels(line.h)
    Drawing.draw(line, y)
    else
    Text.draw(line, line_index, Cursor_line, y, Cursor_pos)
    [4.44]
    [4.1294]
    if line_index >= Screen_top_line then
    y = y+15*Zoom
    if y > Screen_height then break end
    Screen_bottom_line = line_index
    line.y = y
    if line.mode == 'text' and line.data == '' then
    button('draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},
    icon = icon.insert_drawing,
    onpress1 = function()
    table.insert(Lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})
    if Cursor_line >= line_index then
    Cursor_line = Cursor_line+1
    end
    end})
    if line_index == Cursor_line then
    love.graphics.setColor(0,0,0)
    love.graphics.print('_', 25, y+6) -- drop the cursor down a bit to account for the increased font size
    end
    elseif line.mode == 'drawing' then
    y = y+Drawing.pixels(line.h)
    Drawing.draw(line, y)
    else
    Text.draw(line, line_index, Cursor_line, y, Cursor_pos)
    end
  • edit in main.lua at line 168
    [3.155]
    [3.155]
    end
    elseif chord == 'pagedown' then
    Screen_top_line = Screen_bottom_line
    Cursor_line = Screen_top_line
    Cursor_pos = 1
    elseif chord == 'pageup' then
    -- duplicate some logic from love.draw
    local y = Screen_height
    while y >= 0 do
    if Screen_top_line == 1 then break end
    if Lines[Screen_top_line].mode == 'text' then
    y = y - 15*Zoom
    else
    y = y - Drawing.pixels(Lines[Screen_top_line].h)
    end
    Screen_top_line = Screen_top_line - 1
    end
    if Cursor_line ~= Screen_top_line then
    Cursor_pos = 1
  • edit in main.lua at line 188
    [3.163]
    [34.5015]
    Cursor_line = Screen_top_line
  • edit in drawing.lua at line 180
    [2.688]
    [2.688]
    if drawing.y == nil then return false end -- outside current page