position cursor by clicking on text
[?]
May 17, 2022, 5:42 AM
2INHXC3KRJVZTX2BQ63ZQLHIC5SWPUG4PQKCMLC7SQKN5R7LJZ6QCDependencies
- [2]
3D5RFWHVstop handling drawings in cursor_pos computations - [3]
ZUOL7X6Vmove - [4]
IYW7X3WLleft/right cursor movement, deleting characters - [5]
3CS5KKCIup/down cursor movement - [6]
KHFU5NFDbugfix: up/down across drawings - [7]
XX7G2FFJintermingle freehand line drawings with text - [8]
OTIBCAUJlove2d scaffold - [9]
RJGZD4INbinary search to most natural up/down with proportional fonts - [10]
PRPPZGDYspeed up some obvious common cases - [11]
3SYFA5JQshow cursor even on empty lines - [12]
VVXVV2D2change data model; text can now have metadata - [13]
U76D4P36fix a typo
Change contents
- replacement in main.lua at line 163
love.graphics.print('_', 25+cursor_x(line.data, cursor_pos)*1.5, y+6) -- drop the cursor down a bit to account for the increased font sizelove.graphics.print('_', cursor_x(line.data, cursor_pos), y+6) -- drop the cursor down a bit to account for the increased font size - replacement in main.lua at line 200
for i,drawing in ipairs(lines) doif drawing.mode == 'drawing' thenfor i,line in ipairs(lines) doif line.mode == 'text' then-- move cursorif x >= 16 and y >= line.y and y < y+25 thencursor_line = icursor_pos = nearest_cursor_pos(line.data, x, 1)endelseif line.mode == 'drawing' thenlocal drawing = line - replacement in main.lua at line 565
if lines[cursor_line].mode == 'text' thenif lines[cursor_line].mode == 'text' and lines[cursor_line-1].mode == 'text' then - replacement in main.lua at line 575
if lines[cursor_line].mode == 'text' thenif lines[cursor_line].mode == 'text' and lines[cursor_line+1].mode == 'text' then - replacement in main.lua at line 738
return text_before_cursor:getWidth()return 25+text_before_cursor:getWidth()*1.5