mirror of
https://github.com/penpot/penpot.git
synced 2025-06-02 02:32:28 +02:00
Merge remote-tracking branch 'origin/main' into develop
This commit is contained in:
commit
fcb4cb38a9
7 changed files with 27 additions and 23 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue