mirror of
https://github.com/penpot/penpot.git
synced 2025-02-04 13:29:14 -05:00
🐛 Importing shapes without fills
This commit is contained in:
parent
6550631003
commit
10b147a25d
1 changed files with 9 additions and 8 deletions
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
(ns app.main.ui.shapes.attrs
|
(ns app.main.ui.shapes.attrs
|
||||||
(:require
|
(:require
|
||||||
|
[app.common.data :as d]
|
||||||
[app.common.spec.radius :as ctr]
|
[app.common.spec.radius :as ctr]
|
||||||
[app.common.spec.shape :refer [stroke-caps-line stroke-caps-marker]]
|
[app.common.spec.shape :refer [stroke-caps-line stroke-caps-marker]]
|
||||||
[app.main.ui.context :as muc]
|
[app.main.ui.context :as muc]
|
||||||
|
@ -201,16 +202,16 @@
|
||||||
(= :image (:type shape))
|
(= :image (:type shape))
|
||||||
(> (count (:fills shape)) 1)
|
(> (count (:fills shape)) 1)
|
||||||
(some #(some? (:fill-color-gradient %)) (:fills shape)))
|
(some #(some? (:fill-color-gradient %)) (:fills shape)))
|
||||||
(obj/set! styles "fill" (str "url(#fill-" render-id ")"))
|
(obj/set! styles "fill" (str "url(#fill-" render-id ")"))
|
||||||
|
|
||||||
;; imported svgs can have fill and fill-opacity attributes
|
;; imported svgs can have fill and fill-opacity attributes
|
||||||
(obj/contains? svg-styles "fill")
|
(obj/contains? svg-styles "fill")
|
||||||
(-> styles
|
(-> styles
|
||||||
(obj/set! "fill" (obj/get svg-styles "fill"))
|
(obj/set! "fill" (obj/get svg-styles "fill"))
|
||||||
(obj/set! "fillOpacity" (obj/get svg-styles "fillOpacity")))
|
(obj/set! "fillOpacity" (obj/get svg-styles "fillOpacity")))
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(add-fill styles (get-in shape [:fills 0]) render-id 0))]
|
(add-fill styles (d/without-nils (get-in shape [:fills 0])) render-id 0))]
|
||||||
|
|
||||||
(-> props
|
(-> props
|
||||||
(obj/merge! svg-attrs)
|
(obj/merge! svg-attrs)
|
||||||
|
|
Loading…
Add table
Reference in a new issue