mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 12:16:38 +02:00
🐛 Fix swap on anidated frames
This commit is contained in:
parent
355af61cda
commit
3f316ca9c9
3 changed files with 11 additions and 5 deletions
|
@ -901,7 +901,8 @@
|
||||||
libraries
|
libraries
|
||||||
nil
|
nil
|
||||||
(:parent-id shape)
|
(:parent-id shape)
|
||||||
(:frame-id shape))
|
(:frame-id shape)
|
||||||
|
{:force-frame? true})
|
||||||
|
|
||||||
new-shape (cond-> new-shape
|
new-shape (cond-> new-shape
|
||||||
(nil? (ctk/get-swap-slot new-shape))
|
(nil? (ctk/get-swap-slot new-shape))
|
||||||
|
|
|
@ -152,9 +152,11 @@
|
||||||
(defn generate-instantiate-component
|
(defn generate-instantiate-component
|
||||||
"Generate changes to create a new instance from a component."
|
"Generate changes to create a new instance from a component."
|
||||||
([changes objects file-id component-id position page libraries]
|
([changes objects file-id component-id position page libraries]
|
||||||
(generate-instantiate-component changes objects file-id component-id position page libraries nil nil nil))
|
(generate-instantiate-component changes objects file-id component-id position page libraries nil nil nil {}))
|
||||||
|
|
||||||
([changes objects file-id component-id position page libraries old-id parent-id frame-id]
|
([changes objects file-id component-id position page libraries old-id parent-id frame-id
|
||||||
|
{:keys [force-frame?]
|
||||||
|
:or {force-frame? false}}]
|
||||||
(let [component (ctf/get-component libraries file-id component-id)
|
(let [component (ctf/get-component libraries file-id component-id)
|
||||||
parent (when parent-id (get objects parent-id))
|
parent (when parent-id (get objects parent-id))
|
||||||
library (get libraries file-id)
|
library (get libraries file-id)
|
||||||
|
@ -166,7 +168,9 @@
|
||||||
component
|
component
|
||||||
(:data library)
|
(:data library)
|
||||||
position
|
position
|
||||||
components-v2)
|
components-v2
|
||||||
|
(cond-> {}
|
||||||
|
force-frame? (assoc :force-frame-id frame-id)))
|
||||||
|
|
||||||
first-shape (cond-> (first new-shapes)
|
first-shape (cond-> (first new-shapes)
|
||||||
(not (nil? parent-id))
|
(not (nil? parent-id))
|
||||||
|
|
|
@ -443,7 +443,8 @@
|
||||||
libraries
|
libraries
|
||||||
(:id component-root)
|
(:id component-root)
|
||||||
parent-id
|
parent-id
|
||||||
frame-id)
|
frame-id
|
||||||
|
{})
|
||||||
|
|
||||||
restore-component
|
restore-component
|
||||||
#(let [restore (dwlh/prepare-restore-component changes library-data (:component-id component-root) it page delta (:id component-root) parent-id frame-id)]
|
#(let [restore (dwlh/prepare-restore-component changes library-data (:component-id component-root) it page delta (:id component-root) parent-id frame-id)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue