clip drawings inside the border
This commit is contained in:
parent
3bc61ed13f
commit
d8e5a1ce12
4
main.lua
4
main.lua
|
@ -75,8 +75,8 @@ function love.update(dt)
|
||||||
if love.mouse.isDown('1') then
|
if love.mouse.isDown('1') then
|
||||||
for i, line in ipairs(lines) do
|
for i, line in ipairs(lines) do
|
||||||
if type(line) == 'table' then
|
if type(line) == 'table' then
|
||||||
local y = love.mouse.getY()
|
local x, y = love.mouse.getX(), love.mouse.getY()
|
||||||
if y >= line.y and y < line.y + line.h then
|
if y >= line.y and y < line.y + line.h and x >= 12 and x < 12+line.w then
|
||||||
lines.current = line
|
lines.current = line
|
||||||
process_drag(line,love.mouse.getX(),love.mouse.getY())
|
process_drag(line,love.mouse.getX(),love.mouse.getY())
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue