mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 06:58:58 -05:00
🐛 Fix broken fills and strokes on comp-v2 migration
This commit is contained in:
parent
6ad6e6f856
commit
166d2b7b68
1 changed files with 14 additions and 5 deletions
|
@ -105,6 +105,9 @@
|
|||
or that are the result of old bugs."
|
||||
[file-data libraries]
|
||||
(let [detached-ids (volatile! #{})
|
||||
valid-color? (sm/validator ::ctc/recent-color)
|
||||
valid-fill? (sm/validator ::cts/fill)
|
||||
valid-stroke? (sm/validator ::cts/stroke)
|
||||
|
||||
detach-shape
|
||||
(fn [container shape]
|
||||
|
@ -115,7 +118,6 @@
|
|||
(vswap! detached-ids conj (:id shape)))
|
||||
(ctk/detach-shape shape)))
|
||||
|
||||
|
||||
fix-missing-image-metadata
|
||||
(fn [file-data]
|
||||
(let [update-object
|
||||
|
@ -152,6 +154,14 @@
|
|||
0
|
||||
gap)))
|
||||
|
||||
;; Fix broken fills
|
||||
(seq (:fills shape))
|
||||
(update :fills (fn [fills] (filterv valid-fill? fills)))
|
||||
|
||||
;; Fix broken strokes
|
||||
(seq (:strokes shape))
|
||||
(update :strokes (fn [strokes] (filterv valid-stroke? strokes)))
|
||||
|
||||
;; Fix some broken layout related attrs, probably
|
||||
;; of copypaste on flex layout betatest period
|
||||
(true? (:layout shape))
|
||||
|
@ -171,10 +181,9 @@
|
|||
|
||||
fix-recent-colors
|
||||
(fn [file-data]
|
||||
(let [valid-color? (sm/validator ::ctc/recent-color)]
|
||||
(d/update-when file-data :recent-colors
|
||||
(fn [colors]
|
||||
(filterv valid-color? colors)))))
|
||||
(d/update-when file-data :recent-colors
|
||||
(fn [colors]
|
||||
(filterv valid-color? colors))))
|
||||
|
||||
fix-orphan-shapes
|
||||
(fn [file-data]
|
||||
|
|
Loading…
Add table
Reference in a new issue