mirror of
https://github.com/penpot/penpot.git
synced 2025-07-07 23:47:16 +02:00
🐛 Fix duplicate component in assets generates wrong main copy
This commit is contained in:
parent
7391a4086a
commit
e59d106315
1 changed files with 6 additions and 3 deletions
|
@ -122,14 +122,17 @@
|
||||||
position (gpt/add (gpt/point (:x main-instance-shape) (:y main-instance-shape))
|
position (gpt/add (gpt/point (:x main-instance-shape) (:y main-instance-shape))
|
||||||
(gpt/point (+ (:width main-instance-shape) 50) 0))
|
(gpt/point (+ (:width main-instance-shape) 50) 0))
|
||||||
|
|
||||||
|
component-instance-extra-data (if components-v2 {:main-instance? true} {})
|
||||||
|
|
||||||
[new-instance-shape new-instance-shapes]
|
[new-instance-shape new-instance-shapes]
|
||||||
(when (and (some? main-instance-page) (some? main-instance-shape))
|
(when (and (some? main-instance-page) (some? main-instance-shape))
|
||||||
(ctn/make-component-instance main-instance-page
|
(ctn/make-component-instance main-instance-page
|
||||||
component
|
component
|
||||||
library-data
|
library-data
|
||||||
position
|
position
|
||||||
true))]
|
true
|
||||||
|
component-instance-extra-data))]
|
||||||
|
|
||||||
[nil nil new-instance-shape new-instance-shapes])
|
[nil nil new-instance-shape new-instance-shapes])
|
||||||
|
|
||||||
(let [component-root (d/seek #(nil? (:parent-id %)) (vals (:objects component)))
|
(let [component-root (d/seek #(nil? (:parent-id %)) (vals (:objects component)))
|
||||||
|
@ -898,7 +901,7 @@
|
||||||
:index index
|
:index index
|
||||||
:ignore-touched true
|
:ignore-touched true
|
||||||
:obj shape'})
|
:obj shape'})
|
||||||
|
|
||||||
(ctn/page? component-container)
|
(ctn/page? component-container)
|
||||||
(assoc :frame-id (:frame-id shape')))))
|
(assoc :frame-id (:frame-id shape')))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue