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

🐛 Fix problem when creating a component instance from grid layout

This commit is contained in:
alonso.torres 2024-09-05 14:41:09 +02:00
parent caf78a6b4d
commit b15b394c65
2 changed files with 8 additions and 3 deletions

View file

@ -79,6 +79,7 @@
- Fix problem with SVG import [Github #4888](https://github.com/penpot/penpot/issues/4888)
- Fix problem with overlay positions in viewer [Taiga #8464](https://tree.taiga.io/project/penpot/issue/8464)
- Fix layer panel overflowing [Taiga #8665](https://tree.taiga.io/project/penpot/issue/8665)
- Fix problem when creating a component instance from grid layout [Github #4881](https://github.com/penpot/penpot/issues/4881)
## 2.1.5

View file

@ -1622,13 +1622,17 @@
(defn remap-grid-cells
"Remaps the shapes ids inside the cells"
[shape ids-map]
(let [do-remap-cells
(let [remap-shape
(fn [id]
(get ids-map id id))
remap-cell
(fn [cell]
(-> cell
(update :shapes #(into [] (keep ids-map) %))))
(update :shapes #(into [] (keep remap-shape) %))))
shape
(-> shape
(update :layout-grid-cells update-vals do-remap-cells))]
(update :layout-grid-cells update-vals remap-cell))]
shape))
(defn merge-cells