Merge driver.love

This commit is contained in:
Kartik K. Agaram 2024-07-25 22:27:21 -07:00
commit bddd673e94
3 changed files with 7 additions and 8 deletions

9
0019-B
View File

@ -1,7 +1,6 @@
B = function()
B = function(font)
-- print('B')
-- recompute various aspects based on the current viewport settings
local font = nil -- ensure a single font object over the whole surface
for _,obj in ipairs(Surface) do
if obj.type == 'line' then
obj.zdata = {}
@ -18,11 +17,11 @@ B = function()
obj.zdata = love.math.newBezierCurve(zdata):render()
elseif obj.type == 'text' then
if obj.w then
update_editor_box(obj, font or obj.editor.font)
if obj.editor and obj.editor.font then font = obj.editor.font end
update_editor_box(obj, font)
if font == nil and obj.editor then font = obj.editor.font end
else
obj.text = love.graphics.newText(love.graphics.getFont(), obj.data)
end
end
end
end
end

View File

@ -108,4 +108,4 @@ compute_layout = function(node, x,y, nodes_to_render, font)
end
end
return x+node.w,y+node.h
end
end

4
0028-A
View File

@ -11,6 +11,6 @@ A = function()
end
compute_viewport_bounds()
-- continue the pipeline
B()
B(font)
-- TODO: ugly that we're manipulating editor objects twice
end
end