line->circle circle->line line->polygon polygon->line circle->polygon polygon->circle
RXE6NQTNS7MFNF24KFEQRVCZFQ44MDO5HPSQGQD555HPEMQA76DAC
ZOOY3ME4BUD6RLWCKZFA62JNN4BMPOXH24HGTFWPWEKDECOXMFUAC
NL5J7Z5H577GPKGNS5TDRVWC55VLA2UCZE34F5WR4AJ5N265UECAC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
H7OEU6WPOKOSKV5RNAM5W62V5SYOY7VEA5VOK6JD5UEBUBIMOKUQC
IFGAJAF7UWM236QV4NWP2C67TJPQGXNBC2RTZCOWPJUJYYC2MMXAC
HWPK4SMPGZMXWXKCVX667676ZWN5Q2XZSTMVAADG7JNRF6XE45RQC
local drawing = current_drawing()
if drawing.pending.mode == 'line' then
drawing.pending.vertices = {drawing.pending.p1}
elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
drawing.pending.vertices = {drawing.pending.center}
end
drawing.pending.mode = 'polygon'
elseif love.mouse.isDown('1') and chord == 'c' then
current_mode = 'circle'
local drawing = current_drawing()
if drawing.pending.mode == 'line' then
drawing.pending.center = drawing.pending.p1
elseif drawing.pending.mode == 'polygon' then
drawing.pending.center = drawing.pending.vertices[1]
end
drawing.pending.mode = 'circle'
assert(drawing.pending.mode == 'freehand')
if drawing.pending.mode == 'freehand' then
drawing.pending.p1 = insert_point(drawing.points, drawing.pending.points[1].x, drawing.pending.points[1].y)
elseif drawing.pending.mode == 'circle' or drawing.pending.mode == 'arc' then
drawing.pending.p1 = drawing.pending.center
end