0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-28 15:41:25 -05:00

🐛 Fix problem with layout child properties

This commit is contained in:
alonso.torres 2024-02-21 15:58:47 +01:00 committed by Andrey Antukh
parent 4fb1247045
commit 2942f28880
2 changed files with 16 additions and 15 deletions

View file

@ -94,7 +94,8 @@
:layout-item-max-w :layout-item-max-w
:layout-item-min-w :layout-item-min-w
:layout-item-absolute :layout-item-absolute
:layout-item-z-index :layout-item-z-index})
:layout-item-z-index :layout-item-z-index
:layout-item-align-self :layout-item-align-self})
(def swap-keep-attrs
#{:layout-item-margin
@ -106,7 +107,8 @@
:layout-item-max-w
:layout-item-min-w
:layout-item-absolute
:layout-item-z-index})
:layout-item-z-index
:layout-item-align-self})
(defn instance-root?
"Check if this shape is the head of a top instance."

View file

@ -1445,19 +1445,18 @@
(defn- update-flex-child-copy-attrs
"Synchronizes the attributes inside the flex-child items (main->copy)"
[changes _shape-main shape-copy main-container main-component copy-container omit-touched?]
(let [do-changes
(fn [cc]
(-> cc
(pcb/with-container copy-container)
(pcb/with-objects (:objects copy-container))
(pcb/update-shapes
(:shapes shape-copy)
(fn [child-copy]
(let [child-main (ctf/get-ref-shape main-container main-component child-copy)]
(-> child-copy
(propagate-attrs child-main ctk/swap-keep-attrs omit-touched?))))
{:ignore-touched true})))]
(pcb/concat-changes changes (do-changes (pcb/empty-changes)))))
(let [new-changes
(-> (pcb/empty-changes)
(pcb/with-container copy-container)
(pcb/with-objects (:objects copy-container))
(pcb/update-shapes
(:shapes shape-copy)
(fn [child-copy]
(let [child-main (ctf/get-ref-shape main-container main-component child-copy)]
(-> child-copy
(propagate-attrs child-main ctk/swap-keep-attrs omit-touched?))))
{:ignore-touched true}))]
(pcb/concat-changes changes new-changes)))
(defn- update-flex-child-main-attrs
"Synchronizes the attributes inside the flex-child items (copy->main)"