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6LG6XYE73DDAJT6KFPAC
H7OEU6WPOKOSKV5RNAM5W62V5SYOY7VEA5VOK6JD5UEBUBIMOKUQC
6LJZN727CRPYR34LV75CQF55YZI3E7MGESYZSFSYAE73SNEZE3FAC
6PUNJS5BSLTYMYMN4JFD7YDEGVQLM5PGAT7PQIG5NIAKLTM5T4PQC
RJGZD4INLQ3IAWLCBYBZQDMP4ICSMZWJX2TRYODDYVUNMGPL6GYAC
UTF73CBLAPLW2J6BUF4Q7N2TETQ2IKSUZ4267UG357V4SFXDFUTAC
FQJ2LBURF7WCHRQH6SQGI6PGH32BAL7FNUTM5MRWM2CBOEUGWU4AC
RXE6NQTNS7MFNF24KFEQRVCZFQ44MDO5HPSQGQD555HPEMQA76DAC
NL5J7Z5H577GPKGNS5TDRVWC55VLA2UCZE34F5WR4AJ5N265UECAC
FMQ74DP324YKGBSTNMHBJMT6FYP5NI26MM43VUPGKODI5DVDCUXQC
ZOOY3ME4BUD6RLWCKZFA62JNN4BMPOXH24HGTFWPWEKDECOXMFUAC
KCIM5UTVV4KIL7SNRZFOW6FUQHGWAPOGQO4QTVNIWWBWMVG6GYNQC
HWPK4SMPGZMXWXKCVX667676ZWN5Q2XZSTMVAADG7JNRF6XE45RQC
T76KKDWZLQSWMXT2ZE2PPNKBKB4W5M4BW5E6ICHKEBDAUBN6FMZAC
3XD6M3CFKZJR365MHXUWJ4HGSDTPYO6WYZ4RGW7ECBBITKVQX24QC
JS6JSYOTXVZRN4XN7TYDY4GCNCFQBSERBPXEJ2TR5A2ITA6JJT2QC
6J6EEUAYIK5DT7LP43IJVEH3UX53ALKKRYOI6AD64MVA6QNIYWXQC
7Q4B6M2DAB6FZX6RGA2ZX2UTP6PG2LC745WNPK7ZMEUCSSGXEUQQC
love.graphics.rectangle('line', 16,line.y, drawingw,pixels(line.h))
if icon[current_mode] then
icon[current_mode](16+drawingw-20, line.y+4)
love.graphics.rectangle('line', 16,line.y, Drawing_width,pixels(line.h))
if icon[Current_mode] then
icon[Current_mode](16+Drawing_width-20, line.y+4)
love.graphics.print('_', cursor_x(line.data, cursor_pos), y+6) -- drop the cursor down a bit to account for the increased font size
love.graphics.print('_', cursor_x(line.data, Cursor_pos), y+6) -- drop the cursor down a bit to account for the increased font size
if x >= 16 and y >= line.y and y < y+15*zoom then
cursor_line = i
cursor_pos = nearest_cursor_pos(line.data, x, 1)
if x >= 16 and y >= line.y and y < y+15*Zoom then
Cursor_line = i
Cursor_pos = nearest_cursor_pos(line.data, x, 1)
if y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 16 and x < 16+drawingw then
if current_mode == 'freehand' then
drawing.pending = {mode=current_mode, points={{x=coord(x-16), y=coord(y-drawing.y)}}}
elseif current_mode == 'line' or current_mode == 'manhattan' then
if y >= drawing.y and y < drawing.y + pixels(drawing.h) and x >= 16 and x < 16+Drawing_width then
if Current_mode == 'freehand' then
drawing.pending = {mode=Current_mode, points={{x=coord(x-16), y=coord(y-drawing.y)}}}
elseif Current_mode == 'line' or Current_mode == 'manhattan' then
Lines[cursor_line].data = string.sub(Lines[cursor_line].data, 1, byteoffset)..t..string.sub(Lines[cursor_line].data, byteoffset+1)
cursor_pos = cursor_pos+1
if filename then
save_to_disk(Lines, filename)
Lines[Cursor_line].data = string.sub(Lines[Cursor_line].data, 1, byteoffset)..t..string.sub(Lines[Cursor_line].data, byteoffset+1)
Cursor_pos = Cursor_pos+1
if Filename then
save_to_disk(Lines, Filename)
table.insert(Lines, cursor_line+1, {mode='text', data=''})
cursor_line = cursor_line+1
cursor_pos = 1
table.insert(Lines, Cursor_line+1, {mode='text', data=''})
Cursor_line = Cursor_line+1
Cursor_pos = 1
if cursor_pos > 1 then
local byte_start = utf8.offset(Lines[cursor_line].data, cursor_pos-1)
local byte_end = utf8.offset(Lines[cursor_line].data, cursor_pos)
if Cursor_pos > 1 then
local byte_start = utf8.offset(Lines[Cursor_line].data, Cursor_pos-1)
local byte_end = utf8.offset(Lines[Cursor_line].data, Cursor_pos)
cursor_pos = utf8.len(Lines[cursor_line-1].data)+1
Lines[cursor_line-1].data = Lines[cursor_line-1].data..Lines[cursor_line].data
table.remove(Lines, cursor_line)
Cursor_pos = utf8.len(Lines[Cursor_line-1].data)+1
Lines[Cursor_line-1].data = Lines[Cursor_line-1].data..Lines[Cursor_line].data
table.remove(Lines, Cursor_line)
if cursor_pos <= #Lines[cursor_line].data then
local byte_start = utf8.offset(Lines[cursor_line].data, cursor_pos)
local byte_end = utf8.offset(Lines[cursor_line].data, cursor_pos+1)
if Cursor_pos <= #Lines[Cursor_line].data then
local byte_start = utf8.offset(Lines[Cursor_line].data, Cursor_pos)
local byte_end = utf8.offset(Lines[Cursor_line].data, Cursor_pos+1)
local old_x = cursor_x(Lines[new_cursor_line].data, cursor_pos)
cursor_line = new_cursor_line
cursor_pos = nearest_cursor_pos(Lines[cursor_line].data, old_x, cursor_pos)
local old_x = cursor_x(Lines[new_cursor_line].data, Cursor_pos)
Cursor_line = new_cursor_line
Cursor_pos = nearest_cursor_pos(Lines[Cursor_line].data, old_x, Cursor_pos)
local old_x = cursor_x(Lines[new_cursor_line].data, cursor_pos)
cursor_line = new_cursor_line
cursor_pos = nearest_cursor_pos(Lines[cursor_line].data, old_x, cursor_pos)
local old_x = cursor_x(Lines[new_cursor_line].data, Cursor_pos)
Cursor_line = new_cursor_line
Cursor_pos = nearest_cursor_pos(Lines[Cursor_line].data, old_x, Cursor_pos)
current_mode = 'circle'
elseif love.mouse.isDown('1') and chord == 'a' and current_mode == 'circle' then
Current_mode = 'circle'
elseif love.mouse.isDown('1') and chord == 'a' and Current_mode == 'circle' then
love.graphics.print("Things you can do:", 16+30,y, 0, zoom)
y = y+15*zoom
love.graphics.print("* Press the mouse button to start drawing a "..current_shape(), 16+30,y, 0, zoom)
y = y+15*zoom
love.graphics.print("* Hover on a point and press 'ctrl+v' to start moving it,", 16+30,y, 0, zoom)
y = y+15*zoom
love.graphics.print("then press the mouse button to finish", 16+30+bullet_indent(),y, 0, zoom)
y = y+15*zoom
love.graphics.print("* Hover on a point or shape and press 'ctrl+d' to delete it", 16+30,y, 0, zoom)
y = y+15*zoom
y = y+15*zoom
if current_mode ~= 'freehand' then
love.graphics.print("* Press 'ctrl+f' to switch to drawing freehand strokes", 16+30,y, 0, zoom)
y = y+15*zoom
love.graphics.print("Things you can do:", 16+30,y, 0, Zoom)
y = y+15*Zoom
love.graphics.print("* Press the mouse button to start drawing a "..current_shape(), 16+30,y, 0, Zoom)
y = y+15*Zoom
love.graphics.print("* Hover on a point and press 'ctrl+v' to start moving it,", 16+30,y, 0, Zoom)
y = y+15*Zoom
love.graphics.print("then press the mouse button to finish", 16+30+bullet_indent(),y, 0, Zoom)
y = y+15*Zoom
love.graphics.print("* Hover on a point or shape and press 'ctrl+d' to delete it", 16+30,y, 0, Zoom)
y = y+15*Zoom
y = y+15*Zoom
if Current_mode ~= 'freehand' then
love.graphics.print("* Press 'ctrl+f' to switch to drawing freehand strokes", 16+30,y, 0, Zoom)
y = y+15*Zoom
if current_mode ~= 'line' then
love.graphics.print("* Press 'ctrl+l' to switch to drawing lines", 16+30,y, 0, zoom)
y = y+15*zoom
if Current_mode ~= 'line' then
love.graphics.print("* Press 'ctrl+l' to switch to drawing lines", 16+30,y, 0, Zoom)
y = y+15*Zoom
if current_mode ~= 'manhattan' then
love.graphics.print("* Press 'ctrl+m' to switch to drawing horizontal/vertical lines", 16+30,y, 0, zoom)
y = y+15*zoom
if Current_mode ~= 'manhattan' then
love.graphics.print("* Press 'ctrl+m' to switch to drawing horizontal/vertical lines", 16+30,y, 0, Zoom)
y = y+15*Zoom
if current_mode ~= 'circle' then
love.graphics.print("* Press 'ctrl+c' to switch to drawing circles/arcs", 16+30,y, 0, zoom)
y = y+15*zoom
if Current_mode ~= 'circle' then
love.graphics.print("* Press 'ctrl+c' to switch to drawing circles/arcs", 16+30,y, 0, Zoom)
y = y+15*Zoom
if current_mode ~= 'polygon' then
love.graphics.print("* Press 'ctrl+g' to switch to drawing polygons", 16+30,y, 0, zoom)
y = y+15*zoom
if Current_mode ~= 'polygon' then
love.graphics.print("* Press 'ctrl+g' to switch to drawing polygons", 16+30,y, 0, Zoom)
y = y+15*Zoom
love.graphics.print("* Press 'ctrl+=' or 'ctrl+-' to zoom in or out", 16+30,y, 0, zoom)
y = y+15*zoom
love.graphics.print("* Press 'ctrl+0' to reset zoom", 16+30,y, 0, zoom)
y = y+15*zoom
y = y+15*zoom
love.graphics.print("Hit 'esc' now to hide this message", 16+30,y, 0, zoom)
y = y+15*zoom
love.graphics.print("* Press 'ctrl+=' or 'ctrl+-' to Zoom in or out", 16+30,y, 0, Zoom)
y = y+15*Zoom
love.graphics.print("* Press 'ctrl+0' to reset Zoom", 16+30,y, 0, Zoom)
y = y+15*Zoom
y = y+15*Zoom
love.graphics.print("Hit 'esc' now to hide this message", 16+30,y, 0, Zoom)
y = y+15*Zoom
love.graphics.print("You're currently drawing a "..current_shape(drawing.pending), 16+30,y, 0, zoom)
y = y+15*zoom
love.graphics.print('Things you can do now:', 16+30,y, 0, zoom)
y = y+15*zoom
if current_mode == 'freehand' then
love.graphics.print('* Release the mouse button to finish drawing the stroke', 16+30,y, 0, zoom)
y = y+15*zoom
elseif current_mode == 'line' or current_mode == 'manhattan' then
love.graphics.print('* Release the mouse button to finish drawing the line', 16+30,y, 0, zoom)
y = y+15*zoom
elseif current_mode == 'circle' then
love.graphics.print("You're currently drawing a "..current_shape(drawing.pending), 16+30,y, 0, Zoom)
y = y+15*Zoom
love.graphics.print('Things you can do now:', 16+30,y, 0, Zoom)
y = y+15*Zoom
if Current_mode == 'freehand' then
love.graphics.print('* Release the mouse button to finish drawing the stroke', 16+30,y, 0, Zoom)
y = y+15*Zoom
elseif Current_mode == 'line' or Current_mode == 'manhattan' then
love.graphics.print('* Release the mouse button to finish drawing the line', 16+30,y, 0, Zoom)
y = y+15*Zoom
elseif Current_mode == 'circle' then
love.graphics.print('* Release the mouse button to finish drawing the circle', 16+30,y, 0, zoom)
y = y+15*zoom
love.graphics.print("* Press 'a' to draw just an arc of a circle", 16+30,y, 0, zoom)
love.graphics.print('* Release the mouse button to finish drawing the circle', 16+30,y, 0, Zoom)
y = y+15*Zoom
love.graphics.print("* Press 'a' to draw just an arc of a circle", 16+30,y, 0, Zoom)
y = y+15*zoom
elseif current_mode == 'polygon' then
love.graphics.print('* Release the mouse button to finish drawing the polygon', 16+30,y, 0, zoom)
y = y+15*zoom
love.graphics.print("* Press 'p' to add a vertex to the polygon", 16+30,y, 0, zoom)
y = y+15*zoom
y = y+15*Zoom
elseif Current_mode == 'polygon' then
love.graphics.print('* Release the mouse button to finish drawing the polygon', 16+30,y, 0, Zoom)
y = y+15*Zoom
love.graphics.print("* Press 'p' to add a vertex to the polygon", 16+30,y, 0, Zoom)
y = y+15*Zoom
love.graphics.print("* Press 'esc' then release the mouse button to cancel the current shape", 16+30,y, 0, zoom)
y = y+15*zoom
y = y+15*zoom
if current_mode ~= 'line' then
love.graphics.print("* Press 'l' to switch to drawing lines", 16+30,y, 0, zoom)
y = y+15*zoom
love.graphics.print("* Press 'esc' then release the mouse button to cancel the current shape", 16+30,y, 0, Zoom)
y = y+15*Zoom
y = y+15*Zoom
if Current_mode ~= 'line' then
love.graphics.print("* Press 'l' to switch to drawing lines", 16+30,y, 0, Zoom)
y = y+15*Zoom
if current_mode ~= 'manhattan' then
love.graphics.print("* Press 'm' to switch to drawing horizontal/vertical lines", 16+30,y, 0, zoom)
y = y+15*zoom
if Current_mode ~= 'manhattan' then
love.graphics.print("* Press 'm' to switch to drawing horizontal/vertical lines", 16+30,y, 0, Zoom)
y = y+15*Zoom
if current_mode ~= 'circle' then
love.graphics.print("* Press 'c' to switch to drawing circles/arcs", 16+30,y, 0, zoom)
y = y+15*zoom
if Current_mode ~= 'circle' then
love.graphics.print("* Press 'c' to switch to drawing circles/arcs", 16+30,y, 0, Zoom)
y = y+15*Zoom
if current_mode ~= 'polygon' then
love.graphics.print("* Press 'g' to switch to drawing polygons", 16+30,y, 0, zoom)
y = y+15*zoom
if Current_mode ~= 'polygon' then
love.graphics.print("* Press 'g' to switch to drawing polygons", 16+30,y, 0, Zoom)
y = y+15*Zoom