about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-11 21:52:09 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-11 21:52:09 -0700
commit1ff2711fd96e25b4673818830df466cbcea3908a (patch)
tree1f420b5560d9ebb4a7cfe791c1b0bce68443c3cc
parentba0d0028eac8cc3eeca74aff7132f1136939591a (diff)
downloadtext.love-1ff2711fd96e25b4673818830df466cbcea3908a.tar.gz
rename
-rw-r--r--main.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.lua b/main.lua
index a2d0a57..5052662 100644
--- a/main.lua
+++ b/main.lua
@@ -77,10 +77,11 @@ function love.update(dt)
   if love.mouse.isDown('1') then
     for i, line in ipairs(lines) do
       if type(line) == 'table' then
+        local drawing = line
         local x, y = love.mouse.getX(), love.mouse.getY()
-        if y >= line.y and y < line.y + line.h and x >= 12 and x < 12+line.w then
-          lines.current = line
-          process_drag(line,love.mouse.getX(),love.mouse.getY())
+        if y >= drawing.y and y < drawing.y + drawing.h and x >= 12 and x < 12+drawing.w then
+          lines.current = drawing
+          process_drag(drawing,love.mouse.getX(),love.mouse.getY())
         end
       end
     end