mouseover on mouse down.
This commit is contained in:
@@ -116,8 +116,19 @@
|
||||
|
||||
(defn style-label [e font mouse-pos]
|
||||
(table! (:label e) :set-style (style :label font (get-color e mouse-pos)))
|
||||
|
||||
e)
|
||||
|
||||
(defn mouse-moved [screen entities options]
|
||||
(let [[x y] (utils/unproject screen options)
|
||||
entities (assoc-in entities [:state :last-pos] [x y])
|
||||
choice-count (dec (count entities))]
|
||||
(when-let [table (get-in entities [:state :table])]
|
||||
(doseq [e (get-in entities [:state :labels])]
|
||||
|
||||
(style-label e (get-in entities [:state :font]) [x y])))
|
||||
entities))
|
||||
|
||||
(defscreen choice-screen
|
||||
:on-show
|
||||
(fn [screen entities options]
|
||||
@@ -191,15 +202,9 @@
|
||||
(assoc-in [:state :table] nil)
|
||||
(select-keys [:state]))))))
|
||||
|
||||
:on-mouse-moved (fn [screen entities options]
|
||||
(let [[x y] (utils/unproject screen options)
|
||||
entities (assoc-in entities [:state :last-pos] [x y])
|
||||
choice-count (dec (count entities))]
|
||||
(when-let [table (get-in entities [:state :table])]
|
||||
(doseq [e (get-in entities [:state :labels])]
|
||||
|
||||
(style-label e (get-in entities [:state :font]) [x y])))
|
||||
entities))
|
||||
:on-mouse-moved mouse-moved
|
||||
:on-touch-dragged mouse-moved
|
||||
:on-touch-down mouse-moved
|
||||
|
||||
:on-resize (fn [{:keys [^FitViewport viewport]} entities {:keys [width height]}]
|
||||
(.update viewport width height)))
|
||||
|
||||
Reference in New Issue
Block a user