4I2LMNEXDHZTOTDKBJXHSZRQDHIBDXQOYJDNGQSZYXRNHZGP7YPAC
5FWVELA5XU72JOLKVJMIIEFUIFPJQD2MEQQZVGLB3PMNVJPJT2PAC
UOTHQWM74AFOCPGQKKPLZXRI5HQFH3SRGI336AVZRGWPR6P256EAC
KEFZWDCOCLPTLSZJKRV4VYAHRITV5T33YKG2VGT332YAUCOBS3EAC
JGESC375DNF2CAB7ZOCSC45X5CGZVOXHSVCN643B3YHTRZRG6CIQC
3QQZ7W4EJ7G4HQM5IYWXICMAHVRGERY4X6AOC6LOV5NSZ4OBICSAC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
JRLBUB6LR2JIAKVQNKF3T4BDICUIJ3HEMRRHX56YP5M5SP7ZS3WAC
line.section_stack = deepcopy(Section_stack)
elseif line.data:match('\u{250c}') then
line.section_stack = deepcopy(Section_stack) -- as it is at the beginning
local section_name = line.data:match('\u{250c}%s*(.*)')
table.insert(Section_stack, section_name)
line.section_begin = true
line.section_name = section_name
line.data = nil
elseif line.data:match('\u{2518}') then
local section_name = line.data:match('\u{2518}%s*(.*)')
if array.find(Section_stack, section_name) then
while table.remove(Section_stack) ~= section_name do
--
end
line.section_end = true
line.section_name = section_name
line.data = nil
end
line.section_stack = deepcopy(Section_stack)
else
-- string
line.section_stack = deepcopy(Section_stack)
if type(line.data) == 'string' then
y = Text.draw(State, line_index, y, --[[startpos]] 1)
xleft = render_stack_left_margin(State, line_index, line, y)
xright = render_stack_right_margin(State, line_index, line, y)
if line.section_name then
App.color(Section_border_color)
local section_text = to_text(line.section_name)
if line.section_begin then
love.graphics.line(xleft,y+Section_border_padding_vertical, xleft,y+State.line_height)
love.graphics.line(xright,y+Section_border_padding_vertical, xright,y+State.line_height)
love.graphics.line(xleft,y+Section_border_padding_vertical, xleft+50-2,y+Section_border_padding_vertical)
love.graphics.draw(section_text, xleft+50,y)
love.graphics.line(xleft+50+App.width(section_text)+2,y+Section_border_padding_vertical, xright,y+Section_border_padding_vertical)
else assert(line.section_end)
love.graphics.line(xleft,y-Section_border_padding_vertical, xleft,y+State.line_height-Section_border_padding_vertical)
love.graphics.line(xright,y-Section_border_padding_vertical, xright,y+State.line_height-Section_border_padding_vertical)
love.graphics.line(xleft,y+State.line_height-Section_border_padding_vertical, xleft+50-2,y+State.line_height-Section_border_padding_vertical)
love.graphics.draw(section_text, xleft+50,y)
love.graphics.line(xleft+50+App.width(section_text)+2,y+State.line_height-Section_border_padding_vertical, xright,y+State.line_height-Section_border_padding_vertical)
end
--? love.graphics.print('aaa', State.left, y)
--? y = y + State.line_height
line.height = debug_log_render[line.data.name](line.data, State.left, y, State.right-State.left)
y = y + line.height
if type(line.data) == 'string' then
local old_left, old_right = State.left,State.right
State.left,State.right = xleft,xright
y = Text.draw(State, line_index, y, --[[startpos]] 1)
State.left,State.right = old_left,old_right
y = y + State.line_height
else
line.height = debug_log_render[line.data.name](line.data, xleft, y, xright-xleft)
y = y + line.height
end
end
end
end
function render_stack_left_margin(State, line_index, line, y)
if line.section_stack == nil then
-- assertion message
for k,v in pairs(line) do
print(k)
end
end
App.color(Section_border_color)
for i=1,#line.section_stack do
local x = State.left + (i-1)*Section_border_padding_horizontal
love.graphics.line(x,y, x,y+tenonauger.height(State, line_index))
if y < 30 then
love.graphics.print(line.section_stack[i], x+State.font_height+5, y+5, --[[vertically]] math.pi/2)
end
if y > App.screen.height-tenonauger.height(State, line_index) then
love.graphics.print(line.section_stack[i], x+State.font_height+5, App.screen.height-App.width(to_text(line.section_stack[i]))-5, --[[vertically]] math.pi/2)
end
end
return State.left + #line.section_stack*Section_border_padding_horizontal
end
function render_stack_right_margin(State, line_index, line, y)
App.color(Section_border_color)
for i=1,#line.section_stack do
local x = State.right - (i-1)*Section_border_padding_horizontal
love.graphics.line(x,y, x,y+tenonauger.height(State, line_index))
if y < 30 then
love.graphics.print(line.section_stack[i], x, y+5, --[[vertically]] math.pi/2)
-- use this sparingly
function to_text(s)
if Text_cache[s] == nil then
Text_cache[s] = App.newText(love.graphics.getFont(), s)
end
return Text_cache[s]
end