extract a function
[?]
Jun 3, 2022, 9:30 PM
HIKLULFQG7Q7L4C5KXR3DV3TBZ2RGWXBJJXIGSE5YQWF37AJOYZACDependencies
- [2]
LXTTOB33extract a couple of files - [3]
HOSPP2ANcrisp font rendering - [4]
DHI6IJCNselecting text and deleting selections - [5]
OYXDYPGSget rid of debug variables - [6]
AYE2VEGJextract a couple of methods - [*]
BULPIBEGbeginnings of a module for the text editor
Change contents
- replacement in text.lua at line 55[3.142]→[3.142:558](∅→∅),[3.558]→[3.128:171](∅→∅),[3.171]→[3.606:823](∅→∅),[3.606]→[3.606:823](∅→∅),[3.823]→[3.172:217](∅→∅),[3.217]→[3.873:919](∅→∅),[3.873]→[3.873:919](∅→∅),[3.919]→[3.218:295](∅→∅),[3.295]→[3.1004:1056](∅→∅),[3.1004]→[3.1004:1056](∅→∅)
if lo thenlocal lo_offset = utf8.offset(line.data, lo)local hi_offset = utf8.offset(line.data, hi)local pos_offset = utf8.offset(line.data, pos)local lo_pxif pos == lo thenlo_px = 0elselocal before = line.data:sub(pos_offset, lo_offset-1)local before_text = App.newText(love.graphics.getFont(), before)lo_px = App.width(before_text)end--? print(lo,pos,hi, '--', lo_offset,pos_offset,hi_offset, '--', lo_px)local s = line.data:sub(lo_offset, hi_offset-1)local text = App.newText(love.graphics.getFont(), s)local text_width = App.width(text)love.graphics.setColor(0.7,0.7,0.9)love.graphics.rectangle('fill', x+lo_px,y, text_width,Line_height)love.graphics.setColor(0,0,0)endText.draw_highlight(line, x,y, pos, lo,hi) - edit in select.lua at line 50
endend-- draw highlight for line corresponding to (lo,hi) given an approximate x,y and pos on the same screen linefunction Text.draw_highlight(line, x,y, pos, lo,hi)if lo thenlocal lo_offset = utf8.offset(line.data, lo)local hi_offset = utf8.offset(line.data, hi)local pos_offset = utf8.offset(line.data, pos)local lo_pxif pos == lo thenlo_px = 0elselocal before = line.data:sub(pos_offset, lo_offset-1)local before_text = App.newText(love.graphics.getFont(), before)lo_px = App.width(before_text)end--? print(lo,pos,hi, '--', lo_offset,pos_offset,hi_offset, '--', lo_px)local s = line.data:sub(lo_offset, hi_offset-1)local text = App.newText(love.graphics.getFont(), s)local text_width = App.width(text)love.graphics.setColor(0.7,0.7,0.9)love.graphics.rectangle('fill', x+lo_px,y, text_width,Line_height)love.graphics.setColor(0,0,0)