🐛 Fix no color when boolean with an SVG

This commit is contained in:
alonso.torres 2021-10-20 14:26:28 +02:00
parent cca1431012
commit 5fd3689333
3 changed files with 15 additions and 2 deletions

View file

@ -33,6 +33,10 @@
[bool-type name shapes objects]
(let [shapes (mapv #(stp/convert-to-path % objects) shapes)
head (if (= bool-type :difference) (first shapes) (last shapes))
head (cond-> head
(and (contains? head :svg-attrs) (nil? (:fill-color head)))
(assoc :fill-color "#000000"))
head-data (select-keys head stp/style-properties)]
[(-> {:id (uuid/next)
:type :bool
@ -51,7 +55,10 @@
(let [shapes (->> (:shapes group)
(map #(get objects %))
(mapv #(stp/convert-to-path % objects)))
head (first shapes)
head (if (= bool-type :difference) (first shapes) (last shapes))
head (cond-> head
(and (contains? head :svg-attrs) (nil? (:fill-color head)))
(assoc :fill-color "#000000"))
head-data (select-keys head stp/style-properties)]
(-> group