turn strokes into horizontal and vertical lines
[?]
May 12, 2022, 5:33 AM
T76KKDWZLQSWMXT2ZE2PPNKBKB4W5M4BW5E6ICHKEBDAUBN6FMZACDependencies
- [2]
3XD6M3CFrefactor - [*]
OTIBCAUJlove2d scaffold - [*]
WAZVXUV2simplest possible way to straighten strokes - [*]
6LJZN727handle chords
Change contents
- edit in main.lua at line 178
endelseif chord == 'C-m' thenlocal drawing,i,shape = select_shape_at_mouse()if drawing thenconvert_horvert(drawing,i,shape) - edit in main.lua at line 208[5.826][6.325]
end-- turn a stroke into either a horizontal or vertical linefunction convert_horvert(drawing, i, shape)local x1,y1 = shape[1].x, shape[1].ylocal x2,y2 = shape[#shape].x, shape[#shape].yif math.abs(x1-x2) > math.abs(y1-y2) thendrawing.shapes[i] = {{x=x1, y=y1}, {x=x2, y=y1}}elsedrawing.shapes[i] = {{x=x1, y=y1}, {x=x1, y=y2}}end