bugfix: lines that aren't drawn from the start
[?]
Jul 1, 2022, 1:00 AM
MYC7XR5QOT2AXHF6UNGSNFFD5VL6UHGUZQBP7PWWLZ5NNXE7UMTACDependencies
- [2]
TNHZZYWPupdate some documentation - [3]
LAW2O3NWextract variable Margin_left - [4]
PLKNHYZ4extract a function - [5]
GJLOKCYKbugfix: clicking past end of screen line - [6]
IWYLK45Kclicking to the right of a line within line width - [7]
5FW7YOFThighlight selection while dragging - [8]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [9]
YJGADSGKdelete unused arg - [10]
HYEAFRZ2split mouse_pressed events between Text and Drawing - [11]
R53OF3ONone bug I've repeatedly run into while testing with Moby Dick - [12]
CPZGQT72go through and fix similar issues - [13]
U52E2XZNfix a crash - [14]
OGUV4HSAremove some memory leaks from rendered fragments - [15]
JCSLDGAHbeginnings of support for multiple shapes - [16]
HOSPP2ANcrisp font rendering - [17]
KZ5GAYRPthis fixes the immediate regression - [18]
6E3HVYWFtest and App helper for mouse clicks - [19]
4VKEE43Zbugfix - [20]
UWNHC4AAredo y computations - [21]
3TFEAQSWstart using some globals - [22]
OYXDYPGSget rid of debug variables - [23]
GCEF4N3Vstop repeatedly checking for line wrapping - [24]
ZZ2B5RPQextract variables for drawing padding - [25]
DLQMM265scroll past first page - [26]
YTSPVDZHfirst successful pagedown test, first bug found by test - [27]
CVGE3SIGI feel confident now that page-down is working. - [28]
5L7K4GBDclicking to the right of a wrapped line - [29]
BOFNXP5Gclicking now moves the cursor even on long, wrapped lines - [30]
VVXVV2D2change data model; text can now have metadata - [31]
65XHTZEKregression: couldn't do many drawing operations because line.y was reset - [32]
CCYSVZA2bugfix: BSOD in #4. - [33]
242L3OQXbugfix: ensure Cursor_line is always on a text line - [34]
B3IWYWSRdelete another arg that can be deduced - [35]
DXT4QTAHa few more integer coordinates - [36]
DAENUOGVeliminate assumptions that line length == size in bytes - [37]
YLKLDF4R. - [38]
MP2TBKU6bugfix: crash in Text.up() after return - [39]
CBPV5SSIstop handling nil screen_line_starting_pos everywhere - [40]
ESETRNLBbugfix: printing the first part of a line at the bottom made it seem non-wrapping - [*]
LXTTOB33extract a couple of files - [*]
BULPIBEGbeginnings of a module for the text editor - [*]
OTIBCAUJlove2d scaffold
Change contents
- edit in text_tests.lua at line 187
function test_click_on_wrapping_line_rendered_from_partway_at_top_of_screen()io.write('\ntest_click_on_wrapping_line_rendered_from_partway_at_top_of_screen')-- display a wrapping line from its second screen lineApp.screen.init{width=80, height=80}-- 12345678901234Lines = load_array{"madam I'm adam"}Line_width = 75Cursor1 = {line=1, pos=8}Screen_top1 = {line=1, pos=7}Screen_bottom1 = {}App.draw()local y = Margin_topApp.screen.check(y, "I'm ada", 'F - test_click_on_wrapping_line_rendered_from_partway_at_top_of_screen/baseline/screen:2')y = y + Line_height-- click past end of second screen lineApp.run_after_mouse_click(App.screen.width-2,y-2, 1)-- cursor moves to end of screen linecheck_eq(Cursor1.line, 1, 'F - test_click_on_wrapping_line_rendered_from_partway_at_top_of_screen/cursor:line')check_eq(Cursor1.pos, 13, 'F - test_click_on_wrapping_line_rendered_from_partway_at_top_of_screen/cursor:pos')end - replacement in text.lua at line 20
local y = line.ylocal y = line.starty - replacement in text.lua at line 662
if line.y == nil then return false end -- outside current pageif line.starty == nil then return false end -- outside current page - replacement in text.lua at line 664
if y < line.y then return false endif y < line.starty then return false end - replacement in text.lua at line 666
return y < line.y + #line.screen_line_starting_pos * Line_heightreturn y < line.starty + Line_height*(#line.screen_line_starting_pos - Text.screen_line_index(line, line.startpos) + 1) - replacement in text.lua at line 675
assert(my >= line.y)assert(my >= line.starty) - replacement in text.lua at line 677
local y = line.yfor screen_line_index,screen_line_starting_pos in ipairs(line.screen_line_starting_pos) dolocal screen_line_starting_byte_offset = Text.offset(line.data, screen_line_starting_pos)local y = line.startylocal start_screen_line_index = Text.screen_line_index(line, line.startpos)for screen_line_index = start_screen_line_index,#line.screen_line_starting_pos dolocal screen_line_starting_pos = line.screen_line_starting_pos[screen_line_index]local screen_line_starting_byte_offset = Text.offset(line.data, screen_line_starting_pos) - edit in text.lua at line 728
endfunction Text.screen_line_index(line, pos)for i = #line.screen_line_starting_pos,1,-1 doif line.screen_line_starting_pos[i] <= pos thenreturn iendend - replacement in text.lua at line 922
line.y = nilline.starty = nilline.startpos = nil - replacement in main.lua at line 23
-- a (y) coord in pixels (updated while painting screen),-- startpos, the index of data the line starts rendering from (if currently on screen), can only be >1 for topmost line on screen-- starty, the y coord in pixels - replacement in main.lua at line 279[7.153]→[7.194:213](∅→∅),[7.2115]→[7.194:213](∅→∅),[7.2400]→[7.194:213](∅→∅),[7.1510]→[7.194:213](∅→∅)
line.y = yline.starty = yline.startpos = 1if line_index == Screen_top1.line thenline.startpos = Screen_top1.posend