0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 00:40:30 -05:00

📎 Simplify distribute-objects fn impl.

This commit is contained in:
Andrey Antukh 2022-01-20 17:15:37 +01:00 committed by Andrés Moya
parent 5409f83167
commit dcd53183a8

View file

@ -1204,9 +1204,10 @@
moved (-> (map #(get objects %) selected)
(gal/distribute-space axis objects))
moved-objects (->> moved (group-by :id))
ids (keys moved-objects)
update-fn (fn [shape] (first (get moved-objects (:id shape))))]
moved (d/index-by :id moved)
ids (keys moved)
update-fn #(get moved (:id %))]
(when (can-distribute? selected)
(rx/of (dch/update-shapes ids update-fn {:reg-objects? true})))))))