0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-13 07:21:40 -05:00

🐛 Fix migration of fills and strokes for components

This commit is contained in:
Alejandro Alonso 2022-03-24 09:07:06 +01:00 committed by Andrey Antukh
parent 0d449f1292
commit a753037178
2 changed files with 17 additions and 1 deletions

View file

@ -9,7 +9,7 @@
[app.common.colors :as clr]
[app.common.uuid :as uuid]))
(def file-version 15)
(def file-version 16)
(def default-color clr/gray-20)
(def root uuid/zero)

View file

@ -355,3 +355,19 @@
(update-page [_ page]
(update page :objects #(d/mapm update-object %)))]
(update data :pages-index #(d/mapm update-page %))))
;; Add fills and strokes to components
(defmethod migrate 16
[data]
(letfn [(update-object [_ object]
(cond-> object
(and (not (= :text (:type object))) (nil? (:strokes object)))
(set-strokes)
(and (not (= :text (:type object))) (nil? (:fills object)))
(set-fills)))
(update-container [_ container]
(update container :objects #(d/mapm update-object %)))]
(-> data
(update :components #(d/mapm update-container %)))))