delete points or shapes
[?]
May 15, 2022, 6:55 AM
FBDRL6LHPTBPMU3R356OLY4XE4ELQQEDXMCZGCBT2RFHLR7VQXQACDependencies
- [2]
VQFBNHU4make point near focus 'pop' - [3]
T664AOUGmake points easier to acquire - [4]
GCUARQ2Gbugfix: clipping in line and manhattan mode - [5]
SNDZOK6Qslightly less strange now that we have the same two ways to move points as any other operation - [6]
IFGAJAF7add a level of indirection to vertices of shapes - [7]
KCIM5UTVrevert: back to freehand - [8]
ZD63LJ2Tbugfix: keep the click to create a new drawing from creating a new shape in the drawing - [9]
JVRL5TWLstore device-independent coordinates inside drawings - [10]
OTIBCAUJlove2d scaffold - [11]
WAZVXUV2simplest possible way to straighten strokes - [12]
3XD6M3CFrefactor - [13]
WDWXNW7Vslightly strange way to move points - [14]
H7OEU6WPexperimental approach to combining keyboard and mouse while drawing - [15]
HWPK4SMPnew mode: manhattan - [16]
JCSLDGAHbeginnings of support for multiple shapes - [17]
D2GCFTTTclean up repl functionality - [18]
6LJZN727handle chords - [19]
O2UFJ6G3switch from freehand to just straight lines - [*]
ZOOY3ME4new mode: circle arc
Change contents
- replacement in main.lua at line 100[6.237]→[3.3:34](∅→∅),[3.34]→[6.277:317](∅→∅),[6.277]→[6.277:317](∅→∅),[6.317]→[2.3:80](∅→∅),[2.80]→[6.317:370](∅→∅),[6.317]→[6.317:370](∅→∅),[6.370]→[2.81:158](∅→∅)
if near(p, mx,my) thenlove.graphics.setColor(1,0,0)love.graphics.circle('line', pixels(p.x)+16,pixels(p.y)+line.y, 4)elselove.graphics.setColor(0,0,0)love.graphics.circle('fill', pixels(p.x)+16,pixels(p.y)+line.y, 2)if p.deleted == nil thenif near(p, mx,my) thenlove.graphics.setColor(1,0,0)love.graphics.circle('line', pixels(p.x)+16,pixels(p.y)+line.y, 4)elselove.graphics.setColor(0,0,0)love.graphics.circle('fill', pixels(p.x)+16,pixels(p.y)+line.y, 2)end - edit in main.lua at line 289[21.694][21.694]
elseif shape.mode == 'deleted' then - edit in main.lua at line 368[21.1549][6.3287]
elseif shape.mode == 'deleted' then - replacement in main.lua at line 472
elseif chord == 'C-d' thenelseif chord == 'C-x' then - replacement in main.lua at line 549
local drawing,p = select_point_at_mouse()local drawing,_,p = select_point_at_mouse() - replacement in main.lua at line 557
local drawing,p = select_point_at_mouse()local drawing,_,p = select_point_at_mouse() - edit in main.lua at line 563
endelseif chord == 'C-d' and not love.mouse.isDown('1') thenlocal drawing,i,p = select_point_at_mouse()if drawing thenfor _,shape in ipairs(drawing.shapes) doif contains_point(shape, i) thenshape.mode = 'deleted'endenddrawing.points[i].deleted = trueendlocal drawing,i,shape = select_shape_at_mouse()if drawing thenshape.mode = 'deleted' - replacement in main.lua at line 613
if on_shape(mx,my, shape) thenif on_shape(mx,my, drawing, shape) then - replacement in main.lua at line 628
for _,point in ipairs(drawing.points) dofor i,point in ipairs(drawing.points) do - replacement in main.lua at line 631
return drawing,pointreturn drawing,i,point - edit in main.lua at line 650
function contains_point(shape, p)if shape.mode == 'freehand' then-- not supportedelseif shape.mode == 'line' thenprint(p, shape.p1, shape.p2)return shape.p1 == p or shape.p2 == pelseif shape.mode == 'polygon' thenreturn table.find(shape.vertices, p)elseif shape.mode == 'circle' thenreturn shape.center == pelseif shape.mode == 'arc' thenreturn shape.center == p-- ugh, how to support angleselseif shape.mode == 'deleted' then-- already doneelseassert(false)endend