From a88d9c190750edb421984bf4a8885b4605c1a021 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 22 Apr 2023 22:30:25 -0700 Subject: [PATCH] =?UTF-8?q?remove=20a=20stray=20use=20of=20L=C3=96VE=20Tex?= =?UTF-8?q?t=20objects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 0021-compute_layout | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/0021-compute_layout b/0021-compute_layout index f13427b..a438942 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