diff --git a/0021-compute_layout b/0021-compute_layout index db40c0d..96da7ce 100644 --- a/0021-compute_layout +++ b/0021-compute_layout @@ -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 \ No newline at end of file +end