fixed bug with love.mousemoved

This commit is contained in:
Paul Liverman III 2016-04-17 01:27:06 -07:00
parent a541640cfe
commit 2a74d356dc
6 changed files with 6 additions and 7 deletions

View File

@ -197,7 +197,7 @@ do
if mousemoved_event then if mousemoved_event then
self.head.mousemoved = function(self, x, y, dx, dy) self.head.mousemoved = function(self, x, y, dx, dy)
if self.selected then if self.selected then
self.parent:move(y, dx) self.parent:move(dx, dy)
return true return true
end end
return false return false

View File

@ -126,7 +126,7 @@ pop.draw = function(element)
end end
end end
end end
pop.mousemoved = function(self, x, y, dx, dy) pop.mousemoved = function(x, y, dx, dy)
if pop.focused and pop.focused.mousemoved then if pop.focused and pop.focused.mousemoved then
return pop.focused:mousemoved(x, y, dx, dy) return pop.focused:mousemoved(x, y, dx, dy)
end end

View File

@ -197,7 +197,7 @@ do
if mousemoved_event then if mousemoved_event then
self.head.mousemoved = function(self, x, y, dx, dy) self.head.mousemoved = function(self, x, y, dx, dy)
if self.selected then if self.selected then
self.parent:move(y, dx) self.parent:move(dx, dy)
return true return true
end end
return false return false

View File

@ -126,7 +126,7 @@ pop.draw = function(element)
end end
end end
end end
pop.mousemoved = function(self, x, y, dx, dy) pop.mousemoved = function(x, y, dx, dy)
if pop.focused and pop.focused.mousemoved then if pop.focused and pop.focused.mousemoved then
return pop.focused:mousemoved(x, y, dx, dy) return pop.focused:mousemoved(x, y, dx, dy)
end end

View File

@ -53,8 +53,7 @@ class window extends element
if mousemoved_event if mousemoved_event
@head.mousemoved = (x, y, dx, dy) => @head.mousemoved = (x, y, dx, dy) =>
if @selected if @selected
-- for some reason, y and dx are actually dx and dy...what the fuck? (note: in version 0.10.0 AND 0.10.1) @parent\move dx, dy
@parent\move y, dx --dx, dy
return true return true
return false return false

View File

@ -102,7 +102,7 @@ pop.draw = (element=pop.screen) ->
for i = 1, #element.child for i = 1, #element.child
pop.draw element.child[i] pop.draw element.child[i]
pop.mousemoved = (x, y, dx, dy) => pop.mousemoved = (x, y, dx, dy) ->
if pop.focused and pop.focused.mousemoved if pop.focused and pop.focused.mousemoved
return pop.focused\mousemoved x, y, dx, dy return pop.focused\mousemoved x, y, dx, dy