mirror of
https://github.com/penpot/penpot.git
synced 2025-02-15 03:28:25 -05:00
🐛 Fix migrating old components should not clip the content
This commit is contained in:
parent
d5b2a91bce
commit
3bc6d2b0a7
1 changed files with 11 additions and 8 deletions
|
@ -806,7 +806,8 @@
|
||||||
:width (:width (:selrect root-shape))
|
:width (:width (:selrect root-shape))
|
||||||
:height (:height (:selrect root-shape))
|
:height (:height (:selrect root-shape))
|
||||||
:name (:name component)
|
:name (:name component)
|
||||||
:shapes [new-id]})
|
:shapes [new-id]
|
||||||
|
:show-content true})
|
||||||
(assoc :frame-id nil
|
(assoc :frame-id nil
|
||||||
:parent-id nil))
|
:parent-id nil))
|
||||||
root-shape' (assoc root-shape
|
root-shape' (assoc root-shape
|
||||||
|
@ -846,13 +847,15 @@
|
||||||
|
|
||||||
(fix-shape [shape]
|
(fix-shape [shape]
|
||||||
(if (or (nil? (:parent-id shape)) (ctk/instance-head? shape))
|
(if (or (nil? (:parent-id shape)) (ctk/instance-head? shape))
|
||||||
|
(let [frame? (= :frame (:type shape))]
|
||||||
(assoc shape
|
(assoc shape
|
||||||
:type :frame ; Old groups must be converted
|
:type :frame ; Old groups must be converted
|
||||||
:fills (or (:fills shape) []) ; to frames and conform to spec
|
:fills (or (:fills shape) []) ; to frames and conform to spec
|
||||||
:shapes (or (:shapes shape) [])
|
: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)
|
:rx (or (:rx shape) 0)
|
||||||
:ry (or (:ry shape) 0))
|
:ry (or (:ry shape) 0)))
|
||||||
shape))]
|
shape))]
|
||||||
(-> file-data
|
(-> file-data
|
||||||
(update :pages-index update-vals fix-container)
|
(update :pages-index update-vals fix-container)
|
||||||
|
|
Loading…
Add table
Reference in a new issue