mirror of
https://github.com/penpot/penpot.git
synced 2025-02-09 00:28:20 -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."
|
or that are the result of old bugs."
|
||||||
[file-data libraries]
|
[file-data libraries]
|
||||||
(let [detached-ids (volatile! #{})
|
(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
|
detach-shape
|
||||||
(fn [container shape]
|
(fn [container shape]
|
||||||
|
@ -115,7 +118,6 @@
|
||||||
(vswap! detached-ids conj (:id shape)))
|
(vswap! detached-ids conj (:id shape)))
|
||||||
(ctk/detach-shape shape)))
|
(ctk/detach-shape shape)))
|
||||||
|
|
||||||
|
|
||||||
fix-missing-image-metadata
|
fix-missing-image-metadata
|
||||||
(fn [file-data]
|
(fn [file-data]
|
||||||
(let [update-object
|
(let [update-object
|
||||||
|
@ -152,6 +154,14 @@
|
||||||
0
|
0
|
||||||
gap)))
|
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
|
;; Fix some broken layout related attrs, probably
|
||||||
;; of copypaste on flex layout betatest period
|
;; of copypaste on flex layout betatest period
|
||||||
(true? (:layout shape))
|
(true? (:layout shape))
|
||||||
|
@ -171,10 +181,9 @@
|
||||||
|
|
||||||
fix-recent-colors
|
fix-recent-colors
|
||||||
(fn [file-data]
|
(fn [file-data]
|
||||||
(let [valid-color? (sm/validator ::ctc/recent-color)]
|
(d/update-when file-data :recent-colors
|
||||||
(d/update-when file-data :recent-colors
|
(fn [colors]
|
||||||
(fn [colors]
|
(filterv valid-color? colors))))
|
||||||
(filterv valid-color? colors)))))
|
|
||||||
|
|
||||||
fix-orphan-shapes
|
fix-orphan-shapes
|
||||||
(fn [file-data]
|
(fn [file-data]
|
||||||
|
|
Loading…
Add table
Reference in a new issue