new mode: circle
[?]
May 15, 2022, 4:14 AM
FMQ74DP324YKGBSTNMHBJMT6FYP5NI26MM43VUPGKODI5DVDCUXQCDependencies
- [2]
NL5J7Z5Hnew mode: polygon - [*]
OTIBCAUJlove2d scaffold - [*]
JCSLDGAHbeginnings of support for multiple shapes - [*]
H7OEU6WPexperimental approach to combining keyboard and mouse while drawing - [*]
6LJZN727handle chords
Change contents
- edit in main.lua at line 178
elseif lines.current.pending.mode == 'circle' thenlocal mx,my = coord(x-16), coord(y-lines.current.y)if mx >= 0 and mx < 256 and my >= 0 and my < lines.current.h thenlocal center = lines.current.points[lines.current.pending.center]lines.current.pending.radius = math.dist(center.x,center.y, mx,my)table.insert(lines.current.shapes, lines.current.pending)end - edit in main.lua at line 205
elseif current_mode == 'circle' thenlocal j = insert_point(drawing.points, coord(x-16), coord(y-drawing.y))drawing.pending = {mode=current_mode, center=j} - edit in main.lua at line 256
elseif shape.mode == 'circle' thenlocal center = drawing.points[shape.center]love.graphics.circle('line', pixels(center.x)+left,pixels(center.y)+top, pixels(shape.radius)) - edit in main.lua at line 295
elseif shape.mode == 'circle' thenlocal center = drawing.points[shape.center]local mx,my = coord(love.mouse.getX()-16), coord(love.mouse.getY()-drawing.y)if mx < 0 or mx >= 256 or my < 0 or my >= drawing.h thenreturnendlocal cx,cy = pixels(center.x)+left, pixels(center.y)+toplove.graphics.circle('line', cx,cy, math.dist(cx,cy, love.mouse.getX(),love.mouse.getY())) - edit in main.lua at line 315
elseif shape.mode == 'circle' thenlocal center = drawing.points[shape.center]return math.dist(center.x,center.y, x,y) == shape.radius - edit in main.lua at line 413
elseif chord == 'C-c' thencurrent_mode = 'circle' - edit in main.lua at line 539[7.464]
function math.dist(x1,y1, x2,y2) return ((x2-x1)^2+(y2-y1)^2)^0.5 end