about summary refs log tree commit diff stats
path: root/search.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-04-01 16:29:17 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-04-01 18:12:29 -0700
commit876d6298b40fc8b00bf559d4ec2d909ab1e6bc80 (patch)
tree8a949ceac0f9c6010a6de42518683ba9b75a3450 /search.lua
parent4ab901c92e11f47828bc7f5f16d8d2250812d53f (diff)
downloadlines.love-876d6298b40fc8b00bf559d4ec2d909ab1e6bc80.tar.gz
App.width can no longer take a Text
In the process I discovered the horrible fact that Text.x allocates a new Text.
And it gets called (just once, thank goodness) on every single frame.
Diffstat (limited to 'search.lua')
-rw-r--r--search.lua5
1 files changed, 1 insertions, 4 deletions
diff --git a/search.lua b/search.lua
index f7d4732..7d3d335 100644
--- a/search.lua
+++ b/search.lua
@@ -13,10 +13,7 @@ function Text.draw_search_bar(State)
   love.graphics.rectangle('line', 20, y-6, App.screen.width-40, h+2, 2,2)
   App.color(Text_color)
   App.screen.print(State.search_term, 25,y-5)
-  if State.search_text == nil then
-    State.search_text = App.newText(love.graphics.getFont(), State.search_term)
-  end
-  Text.draw_cursor(State, 25+App.width(State.search_text),y-5)
+  Text.draw_cursor(State, 25+App.width(State.search_term),y-5)
 end
 
 function Text.search_next(State)