0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 10:38:13 -05:00

Reimplement deselect-all event.

This commit is contained in:
Andrey Antukh 2016-01-22 19:36:35 +02:00
parent 4b6ad74f6b
commit f4ba1f4fdb

View file

@ -301,9 +301,16 @@
"Mark a shape selected for drawing in the canvas."
[]
(reify
rs/UpdateEvent
(-apply-update [_ state]
(assoc-in state [:workspace :selected] #{}))))
rs/WatchEvent
(-apply-watch [_ state]
(let [selected (get-in state [:workspace :selected])
mevent (rs/swap-state #(assoc-in state [:workspace :selected] #{}))]
(->> (map #(get-in state [:shapes-by-id %]) selected)
(rx/from-coll)
(rx/filter :group)
(rx/map :group)
(rx/map rebuild-group-size)
(rx/merge (rx/just mevent)))))))
(defn copy-selected
"Copy the selected shapes."