bugfix: clipping in line and manhattan mode
[?]
May 15, 2022, 1:40 AM
GCUARQ2GJT3Y5K6LOOA6S7SOBMSXU7VV7LT355TOMFFPBQ3ZVYKACDependencies
- [2]
HWPK4SMPnew mode: manhattan - [3]
Z2CJVAPVlighter border for figures - [4]
YHQC72JXslightly tweak boundary between concerns - [5]
EFMLTMZGbugfix: restrict strokes to the drawing they started in - [6]
ZD63LJ2Tbugfix: keep the click to create a new drawing from creating a new shape in the drawing - [7]
MNWHXPBLmore lightweight; select just the stroke at the mouse - [8]
O2UFJ6G3switch from freehand to just straight lines - [9]
KCIM5UTVrevert: back to freehand - [10]
XX7G2FFJintermingle freehand line drawings with text - [11]
OTIBCAUJlove2d scaffold - [12]
JVRL5TWLstore device-independent coordinates inside drawings - [13]
JCSLDGAHbeginnings of support for multiple shapes - [14]
G77XIN7Mselecting a stroke - [15]
IFGAJAF7add a level of indirection to vertices of shapes - [*]
3XD6M3CFrefactor
Change contents
- replacement in main.lua at line 89
for _,shape in ipairs(line.shapes) dofor i,shape in ipairs(line.shapes) doassert(shape) - edit in main.lua at line 148
table.insert(lines.current.shapes, lines.current.pending) - replacement in main.lua at line 150
local j = insert_point(lines.current.points, coord(x-16), coord(y-lines.current.y))lines.current.pending.p2 = jlocal 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 j = insert_point(lines.current.points, mx,my)lines.current.pending.p2 = jtable.insert(lines.current.shapes, lines.current.pending)end - replacement in main.lua at line 159
if math.abs(mx-p1.x) > math.abs(my-p1.y) thenlocal j = insert_point(lines.current.points, mx, p1.y)lines.current.pending.p2 = jelselocal j = insert_point(lines.current.points, p1.x, my)lines.current.pending.p2 = jif mx >= 0 and mx < 256 and my >= 0 and my < lines.current.h thenif math.abs(mx-p1.x) > math.abs(my-p1.y) thenlocal j = insert_point(lines.current.points, mx, p1.y)lines.current.pending.p2 = jelselocal j = insert_point(lines.current.points, p1.x, my)lines.current.pending.p2 = jendlocal p2 = lines.current.points[lines.current.pending.p2]love.mouse.setPosition(16+pixels(p2.x), lines.current.y+pixels(p2.y))table.insert(lines.current.shapes, lines.current.pending) - edit in main.lua at line 171
local p2 = lines.current.points[lines.current.pending.p2]love.mouse.setPosition(16+pixels(p2.x), lines.current.y+pixels(p2.y)) - edit in main.lua at line 172
table.insert(lines.current.shapes, lines.current.pending) - replacement in main.lua at line 233
love.graphics.line(pixels(p1.x)+left,pixels(p1.y)+top, love.mouse.getX(),love.mouse.getY())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 thenreturnendlove.graphics.line(pixels(p1.x)+left,pixels(p1.y)+top, pixels(mx)+left,pixels(my)+top) - edit in main.lua at line 241
if mx < 0 or mx >= 256 or my < 0 or my >= drawing.h thenreturnend - edit in main.lua at line 395[17.433][3.3419]
assert(shape)