panning cancels click
This commit is contained in:
@@ -1122,7 +1122,13 @@ void main ()
|
||||
e)))
|
||||
|
||||
(defn mouse-moved [screen entities {:keys [input-x input-y] :as options}]
|
||||
(utils/update-override screen (assoc-in entities [:cursor :last-pos] [input-x input-y]) options))
|
||||
(if utils/mobile?
|
||||
(-> entities
|
||||
(assoc-in [:cursor :last] [:main nil])
|
||||
(assoc-in [:cursor :override] nil)
|
||||
(assoc-in [:cursor :down-target] nil)
|
||||
(assoc-in [:label :text] ""))
|
||||
(utils/update-override screen (assoc-in entities [:cursor :last-pos] [input-x input-y]) options)))
|
||||
|
||||
(defn grab-layers [entities]
|
||||
(update-in entities [:room]
|
||||
@@ -1343,7 +1349,7 @@ void main ()
|
||||
entities
|
||||
))
|
||||
|
||||
:on-scrolled
|
||||
#_#_:on-scrolled
|
||||
(fn [{:keys [^OrthographicCamera camera ^FitViewport viewport ^Stage renderer] :as screen} entities options]
|
||||
|
||||
(update-in entities [:cam :zoom] #(* % (+ 1 (/ (double (:amount options)) 100.0 )))))
|
||||
@@ -1447,7 +1453,9 @@ void main ()
|
||||
(set! (. camera zoom) (:zoom (:cam entities)))
|
||||
(set! (.. camera position x) (:x (:cam entities) 160.0))
|
||||
(set! (.. camera position y) (:y (:cam entities) 120.0)))
|
||||
(let [entities (utils/update-override screen entities options)
|
||||
(let [entities (if utils/mobile?
|
||||
entities
|
||||
(utils/update-override screen entities options))
|
||||
entities (play-key-sounds screen entities)
|
||||
entities (update-current-sound-vols! entities)
|
||||
entities (remove-ended-sounds screen entities)]
|
||||
@@ -1470,7 +1478,7 @@ void main ()
|
||||
(filter identity))]
|
||||
(utils/stop-music snd)))
|
||||
|
||||
:on-mouse-moved
|
||||
#_#_:on-mouse-moved
|
||||
mouse-moved
|
||||
|
||||
:on-touch-dragged
|
||||
@@ -1478,6 +1486,7 @@ void main ()
|
||||
|
||||
:on-touch-down
|
||||
(fn [{:keys [^FitViewport viewport] :as screen} entities {:keys [input-x input-y] :as options}]
|
||||
|
||||
(when (utils/contains-point? (.getScreenX viewport) (.getScreenY viewport)
|
||||
(.getScreenWidth viewport) (.getScreenHeight viewport)
|
||||
input-x input-y)
|
||||
@@ -1488,6 +1497,7 @@ void main ()
|
||||
(not (get-in entities [:state :hud-active?]))
|
||||
(= 0.0 (get-in entities [:fade :opacity])))
|
||||
(let [[x y] (utils/unproject screen options)
|
||||
entities (utils/update-override screen (assoc-in entities [:cursor :last-pos] [input-x input-y]) options)
|
||||
interaction (get-interaction entities x y)
|
||||
interacting-entity (get-interacting-entity entities x y)]
|
||||
(-> entities
|
||||
|
||||
Reference in New Issue
Block a user