From 3ab37d3e6a41eff7970079d807a0106c64e10f7d Mon Sep 17 00:00:00 2001 From: Paul Liverman III Date: Sun, 13 Aug 2017 18:37:31 -0700 Subject: [PATCH] #64 implemented --- init.moon | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/init.moon b/init.moon index 3b31a58..c6d3a0b 100644 --- a/init.moon +++ b/init.moon @@ -279,11 +279,13 @@ pop.mousemoved = (x, y, dx, dy, element=pop.screen) -> for i = 1, #element.child pop.mousemoved x, y, dx, dy, element.child[i] - -- if we're hovering over something different, log it + -- if we're hovering over something different, log it, and call handlers if relevant if element == pop.screen and pop.hovered != previously_hovered log " pop.hovered: #{pop.hovered} (#{pop.hovered.data.type})" - -- @todo This is where we call previously_hovered\hovered false, and pop.hovered\hovered true - -- There may be an issue where we are trying only on the lowest object in the hierarchy and we need to check multiple... + if previously_hovered.hovered + previously_hovered\hovered false + if pop.hovered.hovered + pop.hovered\hovered true -- checks element == pop.screen so this only gets called once at the end of recursion if pop.focused and pop.focused.mousemoved and element == pop.screen