mirror of
https://github.com/penpot/penpot.git
synced 2026-04-29 05:08:08 +00:00
⚡ Use faster string formating on filters
This commit is contained in:
parent
9fd5306d1b
commit
4b09172b69
@ -19,10 +19,9 @@
|
||||
|
||||
(defn filter-str
|
||||
[filter-id shape]
|
||||
|
||||
(when (or (seq (->> (:shadow shape) (remove :hidden)))
|
||||
(and (:blur shape) (-> shape :blur :hidden not)))
|
||||
(str/fmt "url(#$0)" [filter-id])))
|
||||
(str/ffmt "url(#%)" filter-id)))
|
||||
|
||||
(mf/defc color-matrix
|
||||
[{:keys [color]}]
|
||||
@ -31,7 +30,7 @@
|
||||
[r g b] [(/ r 255) (/ g 255) (/ b 255)]]
|
||||
[:feColorMatrix
|
||||
{:type "matrix"
|
||||
:values (str/fmt "0 0 0 0 $0 0 0 0 0 $1 0 0 0 0 $2 0 0 0 $3 0" [r g b a])}]))
|
||||
:values (str/ffmt "0 0 0 0 % 0 0 0 0 % 0 0 0 0 % 0 0 0 % 0" r g b a)}]))
|
||||
|
||||
(mf/defc drop-shadow-filter
|
||||
[{:keys [filter-in filter-id params]}]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user