experimental approach to combining keyboard and mouse while drawing
[?]
May 14, 2022, 8:57 PM
H7OEU6WPOKOSKV5RNAM5W62V5SYOY7VEA5VOK6JD5UEBUBIMOKUQCDependencies
- [2]
KCIM5UTVrevert: back to freehand - [3]
HRWN5V6JDevine's suggestion to try to live with just freehand - [*]
OTIBCAUJlove2d scaffold - [*]
6LJZN727handle chords - [*]
D2GCFTTTclean up repl functionality - [*]
3XD6M3CFrefactor
Change contents
- edit in main.lua at line 232
if love.mouse.isDown('1') then return endif in_drawing() then return end - edit in main.lua at line 255
elseif chord == 'C-f' thencurrent_mode = 'freehand'elseif love.mouse.isDown('1') and chord == 'l' thencurrent_mode = 'line'local drawing = current_drawing()assert(drawing.pending.mode == 'freehand')drawing.pending.mode = 'line'drawing.pending.x1 = drawing.pending.points[1].xdrawing.pending.y1 = drawing.pending.points[1].y - edit in main.lua at line 265
current_mode = 'line' - edit in main.lua at line 279
endendendfunction in_drawing()local x, y = love.mouse.getX(), love.mouse.getY()for _,drawing in ipairs(lines) doif type(drawing) == 'table' thenif y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 12 and x < 12+drawingw thenreturn trueendendendreturn falseendfunction current_drawing()local x, y = love.mouse.getX(), love.mouse.getY()for _,drawing in ipairs(lines) doif type(drawing) == 'table' thenif y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 12 and x < 12+drawingw thenreturn drawingend - edit in main.lua at line 304[8.125][8.125]
return nil