about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-15 14:45:23 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-15 14:45:23 -0700
commit4158eee7f6667bdf24a6109e086ea3a819a6eb1c (patch)
tree2f804d20c9192ee29792482261ae40bb5732d7fb
parent65cea736c32289ea2f0850ec5c32cdbcc8e121c1 (diff)
downloadlines.love-4158eee7f6667bdf24a6109e086ea3a819a6eb1c.tar.gz
experiment: only show drawing borders when they can be edited
-rw-r--r--main.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.lua b/main.lua
index 5e9e883..e865193 100644
--- a/main.lua
+++ b/main.lua
@@ -88,8 +88,12 @@ function love.draw()
       -- line drawing
       line.y = y
       y = y+pixels(line.h)
-      love.graphics.setColor(0.75,0.75,0.75)
-      love.graphics.rectangle('line', 16,line.y, drawingw,pixels(line.h))
+
+      local pmx,pmy = love.mouse.getX(), love.mouse.getY()
+      if pmx > 16 and pmx < 16+drawingw and pmy > line.y and pmy < line.y+pixels(line.h) then
+        love.graphics.setColor(0.75,0.75,0.75)
+        love.graphics.rectangle('line', 16,line.y, drawingw,pixels(line.h))
+      end
 
       local mx,my = coord(love.mouse.getX()-16), coord(love.mouse.getY()-line.y)