Don't call the same event multiple times

This commit is contained in:
oakes
2014-08-03 13:17:00 -04:00
parent 40c1bc617a
commit ac1012a471

View File

@@ -91,7 +91,7 @@ in the `screen`."
(defn ^:private actor-gesture-listener (defn ^:private actor-gesture-listener
[{:keys [on-ui-fling on-ui-long-press on-ui-pan on-ui-pinch [{:keys [on-ui-fling on-ui-long-press on-ui-pan on-ui-pinch
on-ui-tap on-ui-touch-down on-ui-touch-up on-ui-zoom]} on-ui-tap on-ui-zoom]}
execute-fn!] execute-fn!]
(proxy [ActorGestureListener] [] (proxy [ActorGestureListener] []
(fling [e vx vy b] (fling [e vx vy b]
@@ -110,12 +110,8 @@ in the `screen`."
(tap [e x y p b] (tap [e x y p b]
(execute-fn! on-ui-tap (execute-fn! on-ui-tap
:event e :input-x x :input-y y :pointer p :button b)) :event e :input-x x :input-y y :pointer p :button b))
(touchDown [e x y p b] ;(touchDown [e x y p b])
(execute-fn! on-ui-touch-down ;(touchUp [e x y p b])
:event e :input-x x :input-y y :pointer p :button b))
(touchUp [e x y p b]
(execute-fn! on-ui-touch-up
:event e :input-x x :input-y y :pointer p :button b))
(zoom [e id d] (zoom [e id d]
(execute-fn! on-ui-zoom :event e :initial-distance id :distance d)))) (execute-fn! on-ui-zoom :event e :initial-distance id :distance d))))
@@ -150,20 +146,12 @@ in the `screen`."
:event e :input-x x :input-y y :pointer p :button b)))) :event e :input-x x :input-y y :pointer p :button b))))
(defn ^:private drag-listener (defn ^:private drag-listener
[{:keys [on-ui-drag on-ui-drag-start on-ui-drag-stop [{:keys [on-ui-drag on-ui-drag-start on-ui-drag-stop]}
on-ui-touch-down on-ui-touch-dragged on-ui-touch-up]}
execute-fn!] execute-fn!]
(proxy [DragListener] [] (proxy [DragListener] []
(touchDown [e x y p b] ;(touchDown [e x y p b])
(execute-fn! on-ui-touch-down ;(touchDragged [e x y p])
:event e :input-x x :input-y y :pointer p :button b) ;(touchUp [e x y p b])
(some? on-ui-touch-down))
(touchDragged [e x y p]
(execute-fn! on-ui-touch-dragged
:event e :input-x x :input-y y :pointer p))
(touchUp [e x y p b]
(execute-fn! on-ui-touch-up
:event e :input-x x :input-y y :pointer p :button b))
(drag [e x y p] (drag [e x y p]
(execute-fn! on-ui-drag :event e :input-x x :input-y y :pointer p)) (execute-fn! on-ui-drag :event e :input-x x :input-y y :pointer p))
(dragStart [e x y p] (dragStart [e x y p]