bugfix: keep the click to create a new drawing from creating a new shape in the drawing
[?]
May 14, 2022, 10:09 PM
ZD63LJ2TGWQQ5KWAX22QUWEYI2X5XUI2UTE4E7LGY26AS7HT2WGQCDependencies
- [2]
K6HMLFLZcolor close to drawing - [3]
JCSLDGAHbeginnings of support for multiple shapes - [4]
H7OEU6WPexperimental approach to combining keyboard and mouse while drawing - [5]
G77XIN7Mselecting a stroke - [6]
O2UFJ6G3switch from freehand to just straight lines - [7]
KCIM5UTVrevert: back to freehand - [8]
JVRL5TWLstore device-independent coordinates inside drawings - [9]
TRCAEE2Aclip drawings inside the border - [10]
HRWN5V6JDevine's suggestion to try to live with just freehand - [11]
POT3XFCTrename - [12]
3XD6M3CFrefactor - [13]
OTIBCAUJlove2d scaffold - [14]
XX7G2FFJintermingle freehand line drawings with text - [15]
EFMLTMZGbugfix: restrict strokes to the drawing they started in
Change contents
- replacement in main.lua at line 85
love.graphics.rectangle('line', 12,line.y, drawingw,pixels(line.h))love.graphics.rectangle('line', 16,line.y, drawingw,pixels(line.h)) - replacement in main.lua at line 87
local mx,my = coord(love.mouse.getX()-12), coord(love.mouse.getY()-line.y)local mx,my = coord(love.mouse.getX()-16), coord(love.mouse.getY()-line.y) - replacement in main.lua at line 95
draw_shape(12,line.y, shape)draw_shape(16,line.y, shape) - replacement in main.lua at line 97
draw_pending_shape(12,line.y, line.pending)draw_pending_shape(16,line.y, line.pending) - replacement in main.lua at line 117
if y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 12 and x < 12+drawingw thenif y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 16 and x < 16+drawingw then - replacement in main.lua at line 119
table.insert(drawing.pending.points, {x=coord(love.mouse.getX()-12), y=coord(love.mouse.getY()-drawing.y)})table.insert(drawing.pending.points, {x=coord(love.mouse.getX()-16), y=coord(love.mouse.getY()-drawing.y)}) - replacement in main.lua at line 138
lines.current.pending.x2 = coord(x-12)lines.current.pending.x2 = coord(x-16) - replacement in main.lua at line 152
if y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 12 and x < 12+drawingw thenif y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 16 and x < 16+drawingw then - replacement in main.lua at line 154
drawing.pending = {mode='freehand', points={x=coord(x-12), y=coord(y-drawing.y)}}drawing.pending = {mode='freehand', points={x=coord(x-16), y=coord(y-drawing.y)}} - replacement in main.lua at line 156
drawing.pending = {mode='line', x1=coord(x-12), y1=coord(y-drawing.y)}drawing.pending = {mode='line', x1=coord(x-16), y1=coord(y-drawing.y)} - replacement in main.lua at line 287
if y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 12 and x < 12+drawingw thenif y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 16 and x < 16+drawingw then - replacement in main.lua at line 299
if y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 12 and x < 12+drawingw thenif y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 16 and x < 16+drawingw then - replacement in main.lua at line 311
if y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 12 and x < 12+drawingw thenlocal mx,my = coord(love.mouse.getX()-12), coord(love.mouse.getY()-drawing.y)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)