0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

🐛 Fixed problem when selecting groups

This commit is contained in:
alonso.torres 2020-10-02 12:40:22 +02:00 committed by Andrey Antukh
parent e9bf3624b7
commit d8e0bab4ad
2 changed files with 8 additions and 2 deletions

View file

@ -151,7 +151,13 @@
objects (dwc/lookup-page-objects state page-id)
group (get objects group-id)
children (map #(get objects %) (:shapes group))
selected (d/seek #(geom/has-point? % position) children)]
;; We need to reverse the children because if two children
;; overlap we want to select the one that's over (and it's
;; in the later vector position
selected (->> children
reverse
(d/seek #(geom/has-point? % position)))]
(when selected
(rx/of deselect-all (select-shape (:id selected))))))))

View file

@ -152,7 +152,7 @@
(defn is-child-selected?
[id]
(letfn [(selector [state]
(let [page-id :current-page-id
(let [page-id (:current-page-id state)
objects (get-in state [:workspace-data :pages-index page-id :objects])
selected (get-in state [:workspace-local :selected])
shape (get objects id)