HYEAFRZ2UEKDYTAE2GDQLHEJBPQASP2NDLMXB7F6MTVK2BKOXKEAC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
EX3GRC2KYJJ5XDNWZNSJMT3G23WFCKZSB6B5HDFL6WG2YHHGDXCQC
VHQCNMARPMNBSIUFLJG7HVK4QGDNPCGNVFLHS3I4IGNVSV5MRLYQC
2INHXC3KRJVZTX2BQ63ZQLHIC5SWPUG4PQKCMLC7SQKN5R7LJZ6QC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
7IKRRESBHMYHHKW4XHUEEKHKPOBLAGZ7A7FJMRU32MTRKIV6S7GQC
AVQ5MC5DWNLI6LUUIPGBLGP4LKRPGWBY4THNY25OBT2FAVHC6MCAC
ZUOL7X6VIPRCMEZURYGNHTDEIP3ZCHZW4PKVKBNXVZL5V4VOE5ZQC
MGOQ5XAVFTWZPBG2O5ZTGSEKU6BRJKQZLDV6CM4737VD2FAEB5JQC
BLWAYPKV3MLDZ4ALXLUJ25AIR6PCIL4RFYNRYLB26GFVC2KQBYBAC
-- move cursor
if x >= 16 and y >= line.y and y < line.y+15*Zoom then
Cursor_line = line_index
Cursor_pos = Text.nearest_cursor_pos(line.data, x, 1)
if Text.in_line(line, x,y) then
Text.move_cursor(line_index, line, x)
local drawing = line
local x, y = love.mouse.getX(), love.mouse.getY()
if y >= drawing.y and y < drawing.y + Drawing.pixels(drawing.h) and x >= 16 and x < 16+Drawing_width then
if Current_drawing_mode == 'freehand' then
drawing.pending = {mode=Current_drawing_mode, points={{x=Drawing.coord(x-16), y=Drawing.coord(y-drawing.y)}}}
elseif Current_drawing_mode == 'line' or Current_drawing_mode == 'manhattan' then
local j = Drawing.insert_point(drawing.points, Drawing.coord(x-16), Drawing.coord(y-drawing.y))
drawing.pending = {mode=Current_drawing_mode, p1=j}
elseif Current_drawing_mode == 'polygon' then
local j = Drawing.insert_point(drawing.points, Drawing.coord(x-16), Drawing.coord(y-drawing.y))
drawing.pending = {mode=Current_drawing_mode, vertices={j}}
elseif Current_drawing_mode == 'circle' then
local j = Drawing.insert_point(drawing.points, Drawing.coord(x-16), Drawing.coord(y-drawing.y))
drawing.pending = {mode=Current_drawing_mode, center=j}
end
Lines.current = drawing
if Drawing.in_drawing(line, x, y) then
Drawing.mouse_pressed(line, x,y, button)
end
function Drawing.in_drawing(drawing, x,y)
return y >= drawing.y and y < drawing.y + Drawing.pixels(drawing.h) and x >= 16 and x < 16+Drawing_width
end
function Drawing.mouse_pressed(drawing, x,y, button)
if Current_drawing_mode == 'freehand' then
drawing.pending = {mode=Current_drawing_mode, points={{x=Drawing.coord(x-16), y=Drawing.coord(y-drawing.y)}}}
elseif Current_drawing_mode == 'line' or Current_drawing_mode == 'manhattan' then
local j = Drawing.insert_point(drawing.points, Drawing.coord(x-16), Drawing.coord(y-drawing.y))
drawing.pending = {mode=Current_drawing_mode, p1=j}
elseif Current_drawing_mode == 'polygon' then
local j = Drawing.insert_point(drawing.points, Drawing.coord(x-16), Drawing.coord(y-drawing.y))
drawing.pending = {mode=Current_drawing_mode, vertices={j}}
elseif Current_drawing_mode == 'circle' then
local j = Drawing.insert_point(drawing.points, Drawing.coord(x-16), Drawing.coord(y-drawing.y))
drawing.pending = {mode=Current_drawing_mode, center=j}
end
Lines.current = drawing