support for naming points
[?]
May 21, 2022, 9:03 PM
BYG5CEMVXANDTBI2ORNVMEY6K3EBRIHZHS4QBK27VONJC5537COQCDependencies
- [2]
2ZYV7D3Whandle tab characters - [3]
DXT4QTAHa few more integer coordinates - [4]
PFT5Y2ZYmove - [5]
2XLZCWZCbugfix: rectangles and squares are now saved - [6]
F63Q4OV7several bugfixes - [7]
IDGP4BJZnew known issue with drawings - [8]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [9]
VHQCNMARseveral more modules - [10]
XNFTJHC4split keyboard handling between Text and Drawing - [11]
5DOC2CBMextract a function - [*]
BULPIBEGbeginnings of a module for the text editor - [*]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [*]
FEEGTRGQbugfix: duplicate character on enter - [*]
OTIBCAUJlove2d scaffold - [*]
6DE7RBZ6move mouse_released events to Drawing - [*]
JCSLDGAHbeginnings of support for multiple shapes - [*]
DLQMM265scroll past first page - [*]
BLWAYPKVextract a module - [*]
NYQ7HD4Dmove - [*]
FS2ITYYHrecord a known issue
Change contents
- replacement in text.lua at line 105
function love.textinput(t)function Text.textinput(t) - edit in text.lua at line 107
if Lines[Cursor_line].mode == 'drawing' then return end - edit in text.lua at line 108
save_to_disk(Lines, Filename) - edit in manual_tests at line 18
select a point and name it - edit in manual_tests at line 37[5.131]
select a point and name it, quit, restart. Name is still visible. - edit in main.lua at line 168
endfunction love.textinput(t)if Current_drawing_mode == 'name' thenlocal drawing = Lines.currentlocal p = drawing.points[drawing.pending.target_point]p.name = p.name..telseText.textinput(t)endsave_to_disk(Lines, Filename) - edit in main.lua at line 189
elseif Current_drawing_mode == 'name' thenif chord == 'return' thenCurrent_drawing_mode = Previous_drawing_modePrevious_drawing_mode = nilelselocal drawing = Lines.currentlocal p = drawing.points[drawing.pending.target_point]if chord == 'escape' thenp.name = nilelseif chord == 'backspace' thenlocal len = utf8.len(p.name)local byte_offset = utf8.offset(p.name, len-1)p.name = string.sub(p.name, 1, byte_offset)endendsave_to_disk(Lines, Filename) - edit in help.lua at line 9
y = y + math.floor(15*Zoom)love.graphics.print("* Hover on a point and press 'ctrl+n' to name it,", 16+30,y, 0, Zoom) - replacement in file.lua at line 51
if shape.mode == 'line' or shape.mode == 'manhattan' thenif shape.mode == 'freehand' then-- no changes neededelseif shape.mode == 'line' or shape.mode == 'manhattan' thenlocal name = shape.p1.name - edit in file.lua at line 56
drawing.points[shape.p1].name = namename = shape.p2.name - edit in file.lua at line 59
drawing.points[shape.p2].name = name - edit in file.lua at line 62
local name = p.name - edit in file.lua at line 64
drawing.points[shape.vertices[i]].name = name - edit in file.lua at line 67
local name = shape.center.name - edit in file.lua at line 69
drawing.point[shape.center].name = name - edit in drawing.lua at line 48
endif p.name then-- todo: cliplove.graphics.print(p.name, Drawing.pixels(p.x)+16+5,Drawing.pixels(p.y)+line.y+5, 0, Zoom) - edit in drawing.lua at line 85
-- todo: clip - edit in drawing.lua at line 180
-- nothing pending; changes are immediately committedelseif shape.mode == 'name' then - edit in drawing.lua at line 476
Lines.current = drawingendelseif chord == 'C-n' and not love.mouse.isDown('1') thenlocal drawing,point_index,p = Drawing.select_point_at_mouse()if drawing thenPrevious_drawing_mode = Current_drawing_modeCurrent_drawing_mode = 'name'p.name = ''drawing.pending = {mode=Current_drawing_mode, target_point=point_index} - edit in README.md at line 19
* No clipping yet for drawings. In particular, circles and point labels canoverflow a drawing.