mirror of
https://github.com/penpot/penpot.git
synced 2025-03-10 14:51:37 -05:00
🐛 Fix import zip text with gradients
This commit is contained in:
parent
0935390761
commit
389c394f39
1 changed files with 13 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
|||
[app.common.pprint :as pp]
|
||||
[app.common.schema :as sm]
|
||||
[app.common.svg :as csvg]
|
||||
[app.common.text :as txt]
|
||||
[app.common.types.components-list :as ctkl]
|
||||
[app.common.types.container :as ctn]
|
||||
[app.common.types.file :as ctf]
|
||||
|
@ -322,8 +323,19 @@
|
|||
(defn create-path [file data]
|
||||
(create-shape file :path data))
|
||||
|
||||
(defn- clean-text-content
|
||||
"Clean the content data so it doesn't break the validation"
|
||||
[content]
|
||||
(letfn [(update-fill [fill]
|
||||
(d/update-in-when fill [:fill-color-gradient :type] keyword))]
|
||||
(txt/transform-nodes
|
||||
(fn [node]
|
||||
(d/update-when node :fills #(mapv update-fill %)))
|
||||
content)))
|
||||
|
||||
(defn create-text [file data]
|
||||
(create-shape file :text data))
|
||||
(let [data (d/update-when data :content clean-text-content)]
|
||||
(create-shape file :text data)))
|
||||
|
||||
(defn create-image [file data]
|
||||
(create-shape file :image data))
|
||||
|
|
Loading…
Add table
Reference in a new issue