mirror of
https://github.com/TangentFoxy/Pop.Box.git
synced 2024-12-15 12:44:20 +00:00
fixed order of click handling
This commit is contained in:
parent
e54fe6cb43
commit
3e49470d3d
@ -146,7 +146,7 @@ pop.mousepressed = function(x, y, button, element)
|
|||||||
pop.focused = element
|
pop.focused = element
|
||||||
pop.events[button] = element
|
pop.events[button] = element
|
||||||
else
|
else
|
||||||
for i = 1, #element.child do
|
for i = #element.child, 1, -1 do
|
||||||
handled = pop.mousepressed(x, y, button, element.child[i])
|
handled = pop.mousepressed(x, y, button, element.child[i])
|
||||||
if handled then
|
if handled then
|
||||||
break
|
break
|
||||||
@ -173,7 +173,7 @@ pop.mousereleased = function(x, y, button, element)
|
|||||||
if clickedHandled or mousereleasedHandled then
|
if clickedHandled or mousereleasedHandled then
|
||||||
return clickedHandled, mousereleasedHandled
|
return clickedHandled, mousereleasedHandled
|
||||||
else
|
else
|
||||||
for i = 1, #element.child do
|
for i = #element.child, 1, -1 do
|
||||||
clickedHandled, mousereleasedHandled = pop.mousereleased(x, y, button, element.child[i])
|
clickedHandled, mousereleasedHandled = pop.mousereleased(x, y, button, element.child[i])
|
||||||
if clickedHandled or mousereleasedHandled then
|
if clickedHandled or mousereleasedHandled then
|
||||||
break
|
break
|
||||||
|
@ -146,7 +146,7 @@ pop.mousepressed = function(x, y, button, element)
|
|||||||
pop.focused = element
|
pop.focused = element
|
||||||
pop.events[button] = element
|
pop.events[button] = element
|
||||||
else
|
else
|
||||||
for i = 1, #element.child do
|
for i = #element.child, 1, -1 do
|
||||||
handled = pop.mousepressed(x, y, button, element.child[i])
|
handled = pop.mousepressed(x, y, button, element.child[i])
|
||||||
if handled then
|
if handled then
|
||||||
break
|
break
|
||||||
@ -173,7 +173,7 @@ pop.mousereleased = function(x, y, button, element)
|
|||||||
if clickedHandled or mousereleasedHandled then
|
if clickedHandled or mousereleasedHandled then
|
||||||
return clickedHandled, mousereleasedHandled
|
return clickedHandled, mousereleasedHandled
|
||||||
else
|
else
|
||||||
for i = 1, #element.child do
|
for i = #element.child, 1, -1 do
|
||||||
clickedHandled, mousereleasedHandled = pop.mousereleased(x, y, button, element.child[i])
|
clickedHandled, mousereleasedHandled = pop.mousereleased(x, y, button, element.child[i])
|
||||||
if clickedHandled or mousereleasedHandled then
|
if clickedHandled or mousereleasedHandled then
|
||||||
break
|
break
|
||||||
|
@ -122,7 +122,7 @@ pop.mousepressed = (x, y, button, element) ->
|
|||||||
pop.focused = element
|
pop.focused = element
|
||||||
pop.events[button] = element
|
pop.events[button] = element
|
||||||
else
|
else
|
||||||
for i = 1, #element.child
|
for i = #element.child, 1, -1
|
||||||
handled = pop.mousepressed x, y, button, element.child[i]
|
handled = pop.mousepressed x, y, button, element.child[i]
|
||||||
if handled
|
if handled
|
||||||
break
|
break
|
||||||
@ -146,7 +146,7 @@ pop.mousereleased = (x, y, button, element) ->
|
|||||||
if clickedHandled or mousereleasedHandled
|
if clickedHandled or mousereleasedHandled
|
||||||
return clickedHandled, mousereleasedHandled
|
return clickedHandled, mousereleasedHandled
|
||||||
else
|
else
|
||||||
for i = 1, #element.child
|
for i = #element.child, 1, -1
|
||||||
clickedHandled, mousereleasedHandled = pop.mousereleased x, y, button, element.child[i]
|
clickedHandled, mousereleasedHandled = pop.mousereleased x, y, button, element.child[i]
|
||||||
if clickedHandled or mousereleasedHandled
|
if clickedHandled or mousereleasedHandled
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user