0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-12 18:18:24 -05:00

🐛 Fix migrating old components should not clip the content

This commit is contained in:
alonso.torres 2024-03-14 13:35:56 +01:00
parent d5b2a91bce
commit 3bc6d2b0a7

View file

@ -806,7 +806,8 @@
:width (:width (:selrect root-shape))
:height (:height (:selrect root-shape))
:name (:name component)
:shapes [new-id]})
:shapes [new-id]
:show-content true})
(assoc :frame-id nil
:parent-id nil))
root-shape' (assoc root-shape
@ -846,13 +847,15 @@
(fix-shape [shape]
(if (or (nil? (:parent-id shape)) (ctk/instance-head? shape))
(let [frame? (= :frame (:type shape))]
(assoc shape
:type :frame ; Old groups must be converted
:fills (or (:fills shape) []) ; to frames and conform to spec
:shapes (or (:shapes shape) [])
:hide-in-viewer (or (:hide-in-viewer shape) true)
:hide-in-viewer (if frame? (boolean (:hide-in-viewer shape)) true)
:show-content (if frame? (boolean (:show-content shape)) true)
:rx (or (:rx shape) 0)
:ry (or (:ry shape) 0))
:ry (or (:ry shape) 0)))
shape))]
(-> file-data
(update :pages-index update-vals fix-container)