select text using mouse drag

[?]
Jun 3, 2022, 3:11 PM
2ENZW7TVCS47BWCA4AIEVGKGMT4Y2TSM5IJ7O5K2VSWNXIN3SG4QC

Dependencies

  • [2] YPHKZVWM extract a new variable
  • [3] Z4XRNDTR find text
  • [4] VHQCNMAR several more modules
  • [5] 6E3HVYWF test and App helper for mouse clicks
  • [6] OTIBCAUJ love2d scaffold
  • [7] 6DE7RBZ6 move mouse_released events to Drawing
  • [8] BYG5CEMV support for naming points
  • [9] 2INHXC3K position cursor by clicking on text
  • [10] AVTNUQYR basic test-enabled framework
  • [11] YKRF5V3Z starting to load/save
  • [12] SNDZOK6Q slightly less strange now that we have the same two ways to move points as any other operation
  • [13] JCSLDGAH beginnings of support for multiple shapes
  • [14] BOFNXP5G clicking now moves the cursor even on long, wrapped lines
  • [15] HYEAFRZ2 split mouse_pressed events between Text and Drawing
  • [16] DHI6IJCN selecting text and deleting selections
  • [17] AVQ5MC5D finish uppercasing all globals
  • [18] WY3JD6W6 bugfix
  • [*] BULPIBEG beginnings of a module for the text editor
  • [*] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [*] AYE2VEGJ extract a couple of methods
  • [*] 3QNOKBFM beginnings of a test harness

Change contents

  • replacement in text.lua at line 502
    [3.433][2.206:273]()
    App.run_after_mousepress(screen_left_margin+8,Margin_top+5, '1')
    [3.433]
    [3.507]
    App.run_after_mouserelease(screen_left_margin+8,Margin_top+5, '1')
  • replacement in text.lua at line 1042
    [3.1792][2.1089:1170]()
    App.run_after_mousepress(screen_left_margin+8,Margin_top+Line_height*2+5, '1')
    [3.1792]
    [3.1871]
    App.run_after_mouserelease(screen_left_margin+8,Margin_top+Line_height*2+5, '1')
  • edit in text.lua at line 1981
    [21.8443]
    [22.264]
    end
    function Text.eq1(a, b)
    return a.line == b.line and a.pos == b.pos
  • edit in main.lua at line 201
    [3.492][3.10941:11240]()
    if love.keyboard.isDown('lshift') or love.keyboard.isDown('rshift') then
    if Selection1.line == nil then
    Selection1 = {line=Cursor1.line, pos=Cursor1.pos}
    end
    else
    if Selection1.line then
    Selection1 = {}
    end
    end
  • edit in main.lua at line 202
    [3.1837]
    [3.361]
    Selection1 = {line=Cursor1.line, pos=Cursor1.pos}
  • replacement in main.lua at line 214
    [3.1485][3.3:41](),[3.2943][3.3:41](),[3.1626][3.3:41]()
    Drawing.mouse_released(x,y, button)
    [3.2943]
    [3.130]
    if Lines.current_drawing then
    Drawing.mouse_released(x,y, button)
    else
    for line_index,line in ipairs(Lines) do
    if line.mode == 'text' then
    if Text.in_line(line, x,y) then
    Text.move_cursor(line_index, line, x, y)
    if Text.eq1(Cursor1, Selection1) then
    Selection1 = {}
    end
    end
    end
    end
    end
  • edit in app.lua at line 203
    [3.834]
    [3.7039]
    App.screen.contents = {}
    App.draw()
    end
    function App.run_after_mouserelease(x,y, button)
    App.mousereleased(x,y, button)