Skip to content

Commit 1566368

Browse files
committed
fix hovered fn
1 parent 69d6952 commit 1566368

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/renderer/tool/transform/select.cljs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,12 @@
6767
" to scale in position."]])
6868

6969
(defn hovered?
70-
[{:keys [active-document] :as db} el intersecting?]
71-
(let [hovered-keys (-> db :documents active-document :hovered-keys)]
72-
(and (empty? (set/intersection (element.h/ancestor-keys db el) hovered-keys))
73-
((if intersecting? bounds/intersected? bounds/contained?)
74-
(:bounds el)
75-
(let [{{:keys [x y width height]} :attrs} (element.h/get-temp db)]
76-
[x y (+ x width) (+ y height)])))))
70+
[db el intersecting?]
71+
(let [{{:keys [x y width height]} :attrs} (element.h/get-temp db)
72+
selection-bounds [x y (+ x width) (+ y height)]]
73+
(if intersecting?
74+
(bounds/intersected? (:bounds el) selection-bounds)
75+
(bounds/contained? (:bounds el) selection-bounds))))
7776

7877
(defn reduce-by-area
7978
[db intersecting? f]

0 commit comments

Comments
 (0)