Still some limitations. The text cursor has to be visible on screen, so if you have a long series of drawings without intervening lines of text you won't be able to scroll through them all.
DLQMM2656JHXX3ONOEM6UIOXKFJFT5QT7RHWK7YS2W77PVZWHRSAC
HYEAFRZ2UEKDYTAE2GDQLHEJBPQASP2NDLMXB7F6MTVK2BKOXKEAC
252M2QMDBMNWHBZY5MDSC7WVYO5JBLJYPVMW5W4IVJCZVYRQ5IQQC
XNFTJHC4QSHNSIWNN7K6QZEZ37GTQYKHS4EPNSVPQCUSWREROGIQC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
MGOQ5XAVFTWZPBG2O5ZTGSEKU6BRJKQZLDV6CM4737VD2FAEB5JQC
AVQ5MC5DWNLI6LUUIPGBLGP4LKRPGWBY4THNY25OBT2FAVHC6MCAC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
XX7G2FFJ4QCGQGD4REAW5QFHVYAKCFUPGZCK7L6DFGS5ISVBYBQQC
7IKRRESBHMYHHKW4XHUEEKHKPOBLAGZ7A7FJMRU32MTRKIV6S7GQC
V5TP27FPD6GPATHPABRW2FKP7BIKY53KL47UVEU5DF4WXEZF7CKAC
HDCVGN6GQPG3GD43E7YOVGVI6MVQTETKMJVXKC5EOC7YXJYTQOLQC
VVXVV2D2F5Y6D6N5VVPUPK3N6GMDTG2YCYPQDYTYEKVKBYHRRYEAC
XJ5J7LDI4AI5J3S67AN5GV6VUIAUCADL2YPGV753ENTW5QUYH5BAC
BJ5X5O4ACBBJ56LRBBSTCW6IBQP4HAEOOOPNH3SKTA4F66YTOIDAC
6F6DF5T3XUD2AEAJT4GBEBZXOVPTGLK5HY36VIW6P6AKAHJQE5UQC
IFGAJAF7UWM236QV4NWP2C67TJPQGXNBC2RTZCOWPJUJYYC2MMXAC
JVRL5TWLBTWMTHJDZSDN5XQDMEIIPVAZBKUP75HMO7JHURAYWG5QC
3SYFA5JQXQSPEFWAZEZ6LI7VUVHWXQHMOMMSUNAKL6S4TQFLZOLQC
VHQCNMARPMNBSIUFLJG7HVK4QGDNPCGNVFLHS3I4IGNVSV5MRLYQC
BLWAYPKV3MLDZ4ALXLUJ25AIR6PCIL4RFYNRYLB26GFVC2KQBYBAC
ZD63LJ2TGWQQ5KWAX22QUWEYI2X5XUI2UTE4E7LGY26AS7HT2WGQC
JCSLDGAH2F6AIY4Z6XM6K4LOMW7EFY3E4NF5YXLMHLTYTX3A4Z3QC
y = y+15*Zoom
line.y = y
if line.mode == 'text' and line.data == '' then
button('draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},
icon = icon.insert_drawing,
onpress1 = function()
table.insert(Lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})
if Cursor_line >= line_index then
Cursor_line = Cursor_line+1
end
end})
if line_index == Cursor_line then
love.graphics.setColor(0,0,0)
love.graphics.print('_', 25, y+6) -- drop the cursor down a bit to account for the increased font size
end
elseif line.mode == 'drawing' then
y = y+Drawing.pixels(line.h)
Drawing.draw(line, y)
else
Text.draw(line, line_index, Cursor_line, y, Cursor_pos)
if line_index >= Screen_top_line then
y = y+15*Zoom
if y > Screen_height then break end
Screen_bottom_line = line_index
line.y = y
if line.mode == 'text' and line.data == '' then
button('draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},
icon = icon.insert_drawing,
onpress1 = function()
table.insert(Lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})
if Cursor_line >= line_index then
Cursor_line = Cursor_line+1
end
end})
if line_index == Cursor_line then
love.graphics.setColor(0,0,0)
love.graphics.print('_', 25, y+6) -- drop the cursor down a bit to account for the increased font size
end
elseif line.mode == 'drawing' then
y = y+Drawing.pixels(line.h)
Drawing.draw(line, y)
else
Text.draw(line, line_index, Cursor_line, y, Cursor_pos)
end
end
elseif chord == 'pagedown' then
Screen_top_line = Screen_bottom_line
Cursor_line = Screen_top_line
Cursor_pos = 1
elseif chord == 'pageup' then
-- duplicate some logic from love.draw
local y = Screen_height
while y >= 0 do
if Screen_top_line == 1 then break end
if Lines[Screen_top_line].mode == 'text' then
y = y - 15*Zoom
else
y = y - Drawing.pixels(Lines[Screen_top_line].h)
end
Screen_top_line = Screen_top_line - 1
end
if Cursor_line ~= Screen_top_line then
Cursor_pos = 1