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FEBLFY4MWFZXTQCI6J7FVZSF5KFE4IHYY42UXMBFAC
7IJQIPGG4G2DJAS2W4MUHB2TTJ75ZST6VNAMUYZXEYOVRIV4FZ5QC
7TQAF4BYIK75EEYCCK7VEUSZHNCWMWIA3HZGQKIILYESUZ5ZZRVQC
SUPHTPXYKS4JBDPASHAYA5OBVJ45QT7ZV2HYNTF7OJYOKKS6DW5QC
JIBCE66ZTWM5WEHEHNKKTRWBJQSQWBDDWPMOJIJR5Q676OSHYCNAC
TZNPEHB3BRUHATVYAODURZUR45TYV62HYWQK5SUXHAOLVGYJVP7AC
KAGTD334AIWFI34VE34OARC44BZDUJRP5R3ZTT6JCQGSYYC3GTVQC
CDW426K3SG5CZ6BFCDQMQEL2NZKRQPF5DIFNS25CHV63R3BWBXRAC
5HBC66CSFQ257TO3DJYBUNKE5RKR47CUJNMYP6Y4F7T6W7LNRV4AC
BF7TW3EKRIDYC6J2Q2J4YOBAVQF55Y3H6KGZIHNXMH4N72MR6GXQC
EVDBN4WF54TPW76XAMHBIMCPZAY6H5E5CRDX4Y3V47UHWWGYPY7AC
4W2NJTC3NV4T3OF4KGGR2ADSXCCTV5GVQMN6TR6D5N4QESFWYY4QC
YOCTF4J3GCMKKVKGO2N5NGHNCRG6FLD54QPI5RGLK4OP667D3NVAC
7P3EK7K2AWA3YDMQBFWJY4TVIKGJ5LI7E4P4F7Z2CVAGVETA3JHAC
ZQMQVMFWZIGWBRCB455IKHPTAOUYPLYCSC44NBPPET557RGVRX3AC
TBB7GHINPHDTKI3B6U3M2OF7UGQ5V5DUHODB7UNKNZMBA4NWKUFAC
HTAB35N62YXTFGITVQAK6DNEKKAUKJQQ27RYO7BBVQKIHXBH6NMQC
AUZQ7ULP65IGCJYIT3U6R42HEJT35R33TQHA7XNK242KWCV6IKMAC
A = function()
B()
-- TODO: ugly that we're manipulating editor objects twice
compute_layout(Page, Page.x,Page.y, Surface)
compute_layout(Page2, Page2.x,Page2.y, Surface)
-- continue the pipeline
love.graphics.setFont(love.graphics.newFont(scale(20))) -- editor objects implicitly depend on current font
node.editor.screen_top1, node.editor.top = schema1_of_y(node.editor, scale(Viewport.y-node.y))
--? print('modified screen_top to', node.editor.screen_top1.line, 'at', node.editor.top, 'vpx')
else
-- adjust editor to start rendering near top of viewport
--? print(Viewport.y)
node.editor.top = Viewport.y%node.editor.line_height
if node.editor.top > 0 then node.editor.top = node.editor.top - node.editor.line_height end
--? print('top', node.editor.top)
if not eq(Cursor_node.editor.screen_top1, old_top) then
--? print('modifying Viewport', Viewport.y, 'based on', Cursor_node.y, Cursor_node.editor.screen_top1.line, Cursor_node.editor.line_height)
Viewport.y = Cursor_node.y + y_of_schema1(Cursor_node.editor, Cursor_node.editor.screen_top1)/Viewport.zoom
--? print('modified Viewport', Viewport.y)
-- Most of the time, we update the screen_top of nodes from Viewport.y.
-- But here we went the other way.
-- It's very important to avoid creating a recurrence, to avoid running
-- both sides of this feedback loop in a single frame. These apps are
-- not very numerically precise (e.g. we force text lines to start at
-- integer pixels regardless of zoom, because that keeps text crisp),
-- and the computations of Viewport.y and node.top will almost certainly
-- not converge. The resulting bugs are extremely difficult to chase
-- down.
-- The optional skip_updating_screen_top_for arg ensures we don't run
-- the other side of the feedback loop.
A(--[[skip updating screen_top for]] Cursor_node)
return
end
pan_viewport_to_contain_cursor(Cursor_node)
print('cursor before', Cursor_node.editor.cursor1.line, Cursor_node.editor.cursor1.pos)
print('cursor after', Cursor_node.editor.cursor1.line, Cursor_node.editor.cursor1.pos)
pan_viewport_to_contain_cursor(Cursor_node)
-- recompute various aspects based on the current viewport settings
for _,obj in ipairs(Surface) do
if obj.type == 'line' then
obj.zdata = {}
for i=1,#obj.data,2 do
table.insert(obj.zdata, vx(obj.data[i]))
table.insert(obj.zdata, vy(obj.data[i+1]))
end
elseif obj.type == 'bezier' then
zdata = {}
for i=1,#obj.data,2 do
table.insert(zdata, vx(obj.data[i]))
table.insert(zdata, vy(obj.data[i+1]))
end
obj.zdata = love.math.newBezierCurve(zdata):render()
elseif obj.type == 'text' then
if obj.w then