mirror of
https://github.com/penpot/penpot.git
synced 2026-04-30 21:59:10 +00:00
🐛 Remove default fill-color and fill-opacity on image shapes
This commit is contained in:
parent
7e8d8eef5a
commit
0392a1649f
@ -9,7 +9,7 @@
|
||||
[app.common.colors :as clr]
|
||||
[app.common.uuid :as uuid]))
|
||||
|
||||
(def file-version 13)
|
||||
(def file-version 14)
|
||||
(def default-color clr/gray-20)
|
||||
(def root uuid/zero)
|
||||
|
||||
|
||||
@ -12,7 +12,8 @@
|
||||
[app.common.geom.shapes.path :as gsp]
|
||||
[app.common.math :as mth]
|
||||
[app.common.pages :as cp]
|
||||
[app.common.uuid :as uuid]))
|
||||
[app.common.uuid :as uuid]
|
||||
[cuerdas.core :as str]))
|
||||
|
||||
;; TODO: revisit this and rename to file-migrations
|
||||
|
||||
@ -300,3 +301,23 @@
|
||||
(update page :objects #(d/mapm update-object %)))]
|
||||
|
||||
(update data :pages-index #(d/mapm update-page %))))
|
||||
|
||||
(defmethod migrate 14
|
||||
[data]
|
||||
(letfn [(update-object [_ {:keys [type] :as object}]
|
||||
(if (= :image type)
|
||||
(let [fill-color (str/upper (:fill-color object))
|
||||
fill-opacity (:fill-opacity object)]
|
||||
(cond-> object
|
||||
(and (= 1 fill-opacity)
|
||||
(or (= "#B1B2B5" fill-color)
|
||||
(= "#7B7D85" fill-color)))
|
||||
(dissoc :fill-color :fill-opacity)))
|
||||
object))
|
||||
|
||||
(update-container [_ container]
|
||||
(update container :objects #(d/mapm update-object %)))]
|
||||
|
||||
(-> data
|
||||
(update :pages-index #(d/mapm update-container %))
|
||||
(update :components #(d/mapm update-container %)))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user