0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 18:48:37 -05:00

🐛 Fix multiple fills with texts are not working properly

This commit is contained in:
Alejandro Alonso 2022-05-13 07:58:02 +02:00
parent 431e42c80a
commit c84017eb72
2 changed files with 7 additions and 6 deletions

View file

@ -246,12 +246,13 @@
[node]
(let [color-attrs (select-keys node [:fill-color :fill-opacity :fill-color-ref-id :fill-color-ref-file :fill-color-gradient])]
(cond-> node
(d/not-empty? color-attrs)
(-> (dissoc :fill-color :fill-opacity :fill-color-ref-id :fill-color-ref-file :fill-color-gradient)
(assoc :fills [color-attrs]))
(nil? (:fills node))
(assoc :fills (:fills txt/default-text-attrs)))))
(assoc :fills (:fills txt/default-text-attrs))
(and (d/not-empty? color-attrs) (nil? (:fills node)))
(-> (dissoc :fill-color :fill-opacity :fill-color-ref-id :fill-color-ref-file :fill-color-gradient)
(assoc :fills [color-attrs])))
))
(defn migrate-content
[content]

View file

@ -66,7 +66,7 @@
(let [fill-image-id (str "fill-image-" render-id)]
{:fill (str "url(#" fill-image-id ")")})
(contains? shape :fill-color-gradient)
(and (contains? shape :fill-color-gradient) (some? (:fill-color-gradient shape)))
(let [fill-color-gradient-id (str "fill-color-gradient_" render-id (if index (str "_" index) ""))]
{:fill (str "url(#" fill-color-gradient-id ")")})