Fix minor conflicts in frame drag/resize detection code

This commit is contained in:
Kenny Shields 2014-02-26 07:37:03 -05:00
parent 55869912e4
commit f5ca78d4ff

View File

@ -470,7 +470,6 @@ function newobject:mousepressed(x, y, button)
local width = self.width
local height = self.height
local selfcol = loveframes.util.BoundingBox(x, self.x, y, self.y, 1, self.width, 1, self.height)
local internals = self.internals
local children = self.children
local dragging = self.dragging
@ -479,8 +478,14 @@ function newobject:mousepressed(x, y, button)
if button == "l" then
-- initiate dragging if not currently dragging
if not dragging and self.hover then
if y < self.y + 25 and self.draggable then
if not dragging and self.hover and self.draggable then
local topcol
if self.canresize then
topcol = loveframes.util.BoundingBox(x, self.x + 2, y, self.y + 2, 1, self.width - 4, 1, 21)
else
topcol = loveframes.util.BoundingBox(x, self.x, y, self.y, 1, self.width, 1, 25)
end
if topcol then
if parent == base then
self.clickx = x - self.x
self.clicky = y - self.y