mirror of
https://github.com/penpot/penpot.git
synced 2025-03-12 15:51:37 -05:00
🐛 Fixed problem when selecting groups
This commit is contained in:
parent
e9bf3624b7
commit
d8e0bab4ad
2 changed files with 8 additions and 2 deletions
|
@ -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))))))))
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue