mirror of
https://github.com/penpot/penpot.git
synced 2025-08-04 09:48:22 +02:00
🐛 Fix group/ungroup shapes inside a component
This commit is contained in:
parent
b273bd44c5
commit
985d5cc20c
4 changed files with 39 additions and 22 deletions
|
@ -49,3 +49,22 @@
|
|||
[shape]
|
||||
(some? (:shape-ref shape)))
|
||||
|
||||
(defn in-component-instance-not-root?
|
||||
"Check if the shape is inside a component instance and
|
||||
is not the root shape."
|
||||
[shape]
|
||||
(and (some? (:shape-ref shape))
|
||||
(nil? (:component-id shape))))
|
||||
|
||||
(defn detach-shape
|
||||
"Remove the links and leave it as a plain shape, detached from any component."
|
||||
[shape]
|
||||
(dissoc shape
|
||||
:component-id
|
||||
:component-file
|
||||
:component-root?
|
||||
:remote-synced?
|
||||
:shape-ref
|
||||
:touched))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue