about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-16 22:13:28 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-16 22:13:28 -0700
commit89b3c7a64fa1d90cc400380b99f58c6b00929021 (patch)
tree2444be04a108da2e3febac0b646c95bb4138083c
parent8382a4f8271948ee595184c025155df4472fef9c (diff)
downloadtext.love-89b3c7a64fa1d90cc400380b99f58c6b00929021.tar.gz
.
-rw-r--r--main.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/main.lua b/main.lua
index ad5e908..ed4fffa 100644
--- a/main.lua
+++ b/main.lua
@@ -85,11 +85,9 @@ function love.draw()
   love.graphics.setColor(1, 1, 1)
   love.graphics.rectangle('fill', 0, 0, screenw-1, screenh-1)
   love.graphics.setColor(0, 0, 0)
-  local text = love.graphics.newText(love.graphics.getFont(), '')
   local y = 0
   for i,line in ipairs(lines) do
     y = y+25
-    text = love.graphics.newText(love.graphics.getFont(), line)
     if line == '' then
       button('draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},
         icon = function(x,y)
@@ -157,6 +155,7 @@ function love.draw()
       draw_pending_shape(16,line.y, line)
     else
       love.graphics.setColor(0,0,0)
+      local text = love.graphics.newText(love.graphics.getFont(), line)
       love.graphics.draw(text, 25,y, 0, 1.5)
       if i == cursor_line then
         -- cursor