remove a stray use of LÖVE Text objects

This commit is contained in:
Kartik K. Agaram 2023-04-22 22:30:25 -07:00
parent c3de51769c
commit a88d9c1907
1 changed files with 2 additions and 3 deletions

View File

@ -17,8 +17,7 @@ compute_layout = function(node, x,y, nodes_to_render, preserve_screen_top_of_cur
else
node.w = 0
for i,s in ipairs(node.data) do
local text = love.graphics.newText(font(20), node.data)
local width = text:getWidth()
local width = love.graphics.getFont():getWidth(s)
if node.w < width then node.w = width end
end
end
@ -95,4 +94,4 @@ compute_layout = function(node, x,y, nodes_to_render, preserve_screen_top_of_cur
end
end
return x+node.w,y+node.h
end
end