slightly strange way to move points
[?]
May 15, 2022, 6:11 AM
WDWXNW7VH57W6KXBNXFV6NPIO5RUS7Q6QNGGI4R6HWIRXLYI5NSACDependencies
- [2]
U76D4P36fix a typo - [3]
FJ4L6N74draw lines by default - [4]
RXE6NQTNchanging your mind mid-shape - [5]
D2GCFTTTclean up repl functionality - [6]
WAZVXUV2simplest possible way to straighten strokes - [7]
T76KKDWZturn strokes into horizontal and vertical lines - [8]
6LJZN727handle chords - [9]
O2UFJ6G3switch from freehand to just straight lines - [10]
HRWN5V6JDevine's suggestion to try to live with just freehand - [11]
KCIM5UTVrevert: back to freehand - [12]
H7OEU6WPexperimental approach to combining keyboard and mouse while drawing - [13]
3XD6M3CFrefactor - [14]
OTIBCAUJlove2d scaffold - [15]
NL5J7Z5Hnew mode: polygon - [16]
ZOOY3ME4new mode: circle arc - [17]
IFGAJAF7add a level of indirection to vertices of shapes - [18]
FMQ74DP3new mode: circle - [19]
JCSLDGAHbeginnings of support for multiple shapes - [20]
HWPK4SMPnew mode: manhattan - [*]
JVRL5TWLstore device-independent coordinates inside drawings - [*]
XX7G2FFJintermingle freehand line drawings with text - [*]
KVHUFUFVreorg
Change contents
- edit in main.lua at line 38
previous_mode = nil - edit in main.lua at line 136
elseif current_mode == 'move' thenlocal drawing = lines.currentlocal x, y = love.mouse.getX(), love.mouse.getY()if y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 16 and x < 16+drawingw thenlocal mx,my = coord(x-16), coord(y-drawing.y)drawing.pending.target_point.x = mxdrawing.pending.target_point.y = myend - edit in main.lua at line 148[24.48][2.3]
if current_mode == 'move' thencurrent_mode = previous_modeprevious_mode = nilreturnend - replacement in main.lua at line 466
elseif chord == 'C-f' thenelseif chord == 'C-f' and not love.mouse.isDown('1') then - replacement in main.lua at line 468
elseif chord == 'C-g' thenelseif chord == 'C-g' and not love.mouse.isDown('1') then - replacement in main.lua at line 484
elseif chord == 'C-c' thenelseif chord == 'C-c' and not love.mouse.isDown('1') then - replacement in main.lua at line 529
elseif chord == 'C-m' thenelseif chord == 'C-m' and not love.mouse.isDown('1') then - replacement in main.lua at line 535
elseif chord == 'C-s' thenelseif chord == 'C-s' and not love.mouse.isDown('1') then - edit in main.lua at line 540
elseif chord == 'C-v' and not love.mouse.isDown('1') thenlocal drawing,p = select_point_at_mouse()if drawing thenprevious_mode = current_modecurrent_mode = 'move'drawing.pending = {target_point=p}lines.current = drawingend - edit in main.lua at line 585
endendendendendendfunction select_point_at_mouse()for _,drawing in ipairs(lines) doif type(drawing) == 'table' thenlocal x, y = love.mouse.getX(), love.mouse.getY()if y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 16 and x < 16+drawingw thenlocal mx,my = coord(love.mouse.getX()-16), coord(love.mouse.getY()-drawing.y)for _,point in ipairs(drawing.points) doassert(point)if near(point, mx,my) thenreturn drawing,point