mirror of
https://github.com/penpot/penpot.git
synced 2025-03-12 07:41:43 -05:00
🐛 Add validation fix for false non root copies
This commit is contained in:
parent
cceb35b053
commit
17a208d67b
1 changed files with 6 additions and 3 deletions
|
@ -486,15 +486,18 @@
|
|||
fix-false-copies
|
||||
(fn [file-data]
|
||||
;; Find component heads that are not main-instance but have not :shape-ref.
|
||||
;; Also shapes that have :shape-ref but are not in a copy.
|
||||
(letfn [(fix-container
|
||||
[container]
|
||||
(d/update-when container :objects update-vals (partial fix-shape container)))
|
||||
|
||||
(fix-shape
|
||||
[container shape]
|
||||
(if (and (ctk/instance-head? shape)
|
||||
(not (ctk/main-instance? shape))
|
||||
(not (ctk/in-component-copy? shape)))
|
||||
(if (or (and (ctk/instance-head? shape)
|
||||
(not (ctk/main-instance? shape))
|
||||
(not (ctk/in-component-copy? shape)))
|
||||
(and (ctk/in-component-copy? shape)
|
||||
(nil? (ctn/get-head-shape (:objects container) shape {:allow-main? true}))))
|
||||
(detach-shape container shape)
|
||||
shape))]
|
||||
(-> file-data
|
||||
|
|
Loading…
Add table
Reference in a new issue