0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-01 01:21:21 -05:00

🐛 Fix blur

This commit is contained in:
Alejandro Alonso 2023-11-10 08:11:26 +01:00 committed by Andrey Antukh
parent a8eb5328a0
commit a19f5fd305

View file

@ -20,11 +20,11 @@
(- (mth/sqrt (* 2 stroke-width stroke-width)) stroke-width))) (- (mth/sqrt (* 2 stroke-width stroke-width)) stroke-width)))
(defn- apply-filters (defn- apply-filters
[type filters] [attr type filters]
(sequence (sequence
(comp (comp
(remove :hidden) (remove :hidden)
(filter #(= (:style %) type)) (filter #(= (attr %) type))
(map (fn [item] (map (fn [item]
{:id (dm/str "filter_" (:id item)) {:id (dm/str "filter_" (:id item))
:type type :type type
@ -40,10 +40,10 @@
;; We can revisit this in the future ;; We can revisit this in the future
#_(->> shape :blur (into []) (blur-filters :background-blur)) #_(->> shape :blur (into []) (blur-filters :background-blur))
(->> shape :shadow (apply-filters :drop-shadow)) (->> shape :shadow (apply-filters :style :drop-shadow))
[{:id "shape" :type :blend-filters}] [{:id "shape" :type :blend-filters}]
(->> shape :shadow (apply-filters :inner-shadow)) (->> shape :shadow (apply-filters :style :inner-shadow))
(->> shape :blur (into []) (apply-filters :layer-blur)))) (->> shape :blur list (apply-filters :type :layer-blur))))
(defn- calculate-filter-bounds (defn- calculate-filter-bounds
[selrect filter-entry] [selrect filter-entry]