Merge pull request #72 from SimonLarsen/imagebutton-fix

Fixed ImageButton checking mask bounds on mask instead of image
This commit is contained in:
Matthias Richter 2019-02-01 23:04:51 +01:00 committed by GitHub
commit 1781d5eec6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ return function(core, normal, ...)
core:registerMouseHit(opt.id, x, y, function(u,v)
-- mouse in image?
u, v = math.floor(u+.5), math.floor(v+.5)
if u < 0 or u >= image:getWidth() or v < 0 or v >= mask:getHeight() then
if u < 0 or u >= image:getWidth() or v < 0 or v >= image:getHeight() then
return false
end