Merge remote-tracking branch 'origin/main' into develop

This commit is contained in:
Andrey Antukh 2021-06-01 12:44:04 +02:00
commit fcb4cb38a9
7 changed files with 27 additions and 23 deletions

View file

@ -82,21 +82,24 @@
([state label ids] (group-shapes state label ids "Group-"))
([state label ids prefix]
(let [page (current-page state)
shapes (dwg/shapes-for-grouping (:objects page) ids)
shapes (dwg/shapes-for-grouping (:objects page) ids)]
(if (empty? shapes)
state
(let [[group rchanges uchanges]
(dwg/prepare-create-group (:objects page) (:id page) shapes prefix true)]
[group rchanges uchanges]
(dwg/prepare-create-group (:objects page) (:id page) shapes prefix true)]
(swap! idmap assoc label (:id group))
(update state :workspace-data
cp/process-changes rchanges))))
(swap! idmap assoc label (:id group))
(update state :workspace-data
cp/process-changes rchanges))))))
(defn make-component
[state label ids]
(let [page (current-page state)
objects (wsh/lookup-page-objects state page-id)
shapes (dwg/shapes-for-grouping objects ids)
[group rchanges uchanges]
(dwlh/generate-add-component ids
(dwlh/generate-add-component shapes
(:objects page)
(:id page)
current-file-id)]