mirror of
https://github.com/penpot/penpot.git
synced 2025-06-24 08:06:59 +02:00
✨ Make filters ID naming consistent with the rest
This commit is contained in:
parent
d0c1a9683a
commit
9fd5306d1b
4 changed files with 19 additions and 19 deletions
|
@ -87,7 +87,7 @@
|
||||||
cap-end (:stroke-cap-end stroke)
|
cap-end (:stroke-cap-end stroke)
|
||||||
|
|
||||||
color (if (some? gradient)
|
color (if (some? gradient)
|
||||||
(str/ffmt "url(#stroke-color-gradient_%s_%s)" render-id index)
|
(str/ffmt "url(#stroke-color-gradient-%s-%s)" render-id index)
|
||||||
(:stroke-color stroke))
|
(:stroke-color stroke))
|
||||||
|
|
||||||
opacity (when-not (some? gradient)
|
opacity (when-not (some? gradient)
|
||||||
|
@ -198,7 +198,7 @@
|
||||||
alignment (:stroke-alignment stroke :center)
|
alignment (:stroke-alignment stroke :center)
|
||||||
width (:stroke-width stroke 0)
|
width (:stroke-width stroke 0)
|
||||||
|
|
||||||
props #js {:id (dm/str "stroke-color-gradient_" render-id "_" index)
|
props #js {:id (dm/str "stroke-color-gradient-" render-id "-" index)
|
||||||
:gradient gradient
|
:gradient gradient
|
||||||
:shape shape}]
|
:shape shape}]
|
||||||
[:*
|
[:*
|
||||||
|
@ -391,7 +391,7 @@
|
||||||
props
|
props
|
||||||
(if (or (some? (->> shape-shadow (remove :hidden) seq))
|
(if (or (some? (->> shape-shadow (remove :hidden) seq))
|
||||||
(not ^boolean (:hidden shape-blur)))
|
(not ^boolean (:hidden shape-blur)))
|
||||||
(obj/set! props "filter" (dm/fmt "url(#filter_%)" render-id))
|
(obj/set! props "filter" (dm/fmt "url(#filter-%)" render-id))
|
||||||
props))
|
props))
|
||||||
|
|
||||||
svg-attrs (attrs/get-svg-props shape render-id)
|
svg-attrs (attrs/get-svg-props shape render-id)
|
||||||
|
@ -494,11 +494,11 @@
|
||||||
(cond
|
(cond
|
||||||
(and (some? shape-blur)
|
(and (some? shape-blur)
|
||||||
(not ^boolean (:hidden shape-blur)))
|
(not ^boolean (:hidden shape-blur)))
|
||||||
(obj/set! props "filter" (dm/fmt "url(#filter_blur_%)" render-id))
|
(obj/set! props "filter" (dm/fmt "url(#filter-blur-%)" render-id))
|
||||||
|
|
||||||
(and (empty? shape-fills)
|
(and (empty? shape-fills)
|
||||||
(some? (->> shape-shadow (remove :hidden) seq)))
|
(some? (->> shape-shadow (remove :hidden) seq)))
|
||||||
(obj/set! props "filter" (dm/fmt "url(#filter_%)" render-id))))]
|
(obj/set! props "filter" (dm/fmt "url(#filter-%)" render-id))))]
|
||||||
|
|
||||||
|
|
||||||
(when (d/not-empty? shape-strokes)
|
(when (d/not-empty? shape-strokes)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(defn get-filter-id []
|
(defn get-filter-id []
|
||||||
(str "filter_" (uuid/next)))
|
(dm/str "filter-" (uuid/next)))
|
||||||
|
|
||||||
(defn filter-str
|
(defn filter-str
|
||||||
[filter-id shape]
|
[filter-id shape]
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
|
|
||||||
type (dm/get-prop shape :type)
|
type (dm/get-prop shape :type)
|
||||||
render-id (h/use-render-id)
|
render-id (h/use-render-id)
|
||||||
filter-id (dm/str "filter_" render-id)
|
filter-id (dm/str "filter-" render-id)
|
||||||
styles (-> (obj/create)
|
styles (-> (obj/create)
|
||||||
(obj/set! "pointerEvents" pointer-events)
|
(obj/set! "pointerEvents" pointer-events)
|
||||||
(cond-> (and blend-mode (not= blend-mode :normal))
|
(cond-> (and blend-mode (not= blend-mode :normal))
|
||||||
|
@ -116,8 +116,8 @@
|
||||||
[:defs
|
[:defs
|
||||||
[:& defs/svg-defs {:shape shape :render-id render-id}]
|
[:& defs/svg-defs {:shape shape :render-id render-id}]
|
||||||
[:& filters/filters {:shape shape :filter-id filter-id}]
|
[:& filters/filters {:shape shape :filter-id filter-id}]
|
||||||
[:& filters/filters {:shape shape-without-blur :filter-id (dm/fmt "filter_shadow_%" render-id)}]
|
[:& filters/filters {:shape shape-without-blur :filter-id (dm/fmt "filter-shadow-%" render-id)}]
|
||||||
[:& filters/filters {:shape shape-without-shadows :filter-id (dm/fmt "filter_blur_%" render-id)}]
|
[:& filters/filters {:shape shape-without-shadows :filter-id (dm/fmt "filter-blur-%" render-id)}]
|
||||||
[:& fills/fills {:shape shape :render-id render-id}]
|
[:& fills/fills {:shape shape :render-id render-id}]
|
||||||
[:& frame/frame-clip-def {:shape shape :render-id render-id}]]
|
[:& frame/frame-clip-def {:shape shape :render-id render-id}]]
|
||||||
|
|
||||||
|
|
|
@ -173,13 +173,13 @@
|
||||||
(fn [] (rx/dispose! subs)))))
|
(fn [] (rx/dispose! subs)))))
|
||||||
[:g.gradient-handlers
|
[:g.gradient-handlers
|
||||||
[:defs
|
[:defs
|
||||||
[:& gradient-line-drop-shadow-filter {:id "gradient_line_drop_shadow" :from-p from-p :to-p to-p :zoom zoom}]
|
[:& gradient-line-drop-shadow-filter {:id "gradient-line-drop-shadow" :from-p from-p :to-p to-p :zoom zoom}]
|
||||||
[:& gradient-line-drop-shadow-filter {:id "gradient_width_line_drop_shadow" :from-p from-p :to-p width-p :zoom zoom}]
|
[:& gradient-line-drop-shadow-filter {:id "gradient-width-line-drop-shadow" :from-p from-p :to-p width-p :zoom zoom}]
|
||||||
[:& gradient-square-drop-shadow-filter {:id "gradient_square_from_drop_shadow" :point from-p :zoom zoom}]
|
[:& gradient-square-drop-shadow-filter {:id "gradient-square-from-drop-shadow" :point from-p :zoom zoom}]
|
||||||
[:& gradient-square-drop-shadow-filter {:id "gradient_square_to_drop_shadow" :point to-p :zoom zoom}]
|
[:& gradient-square-drop-shadow-filter {:id "gradient-square-to-drop-shadow" :point to-p :zoom zoom}]
|
||||||
[:& gradient-width-handler-shadow-filter {:id "gradient_width_handler_drop_shadow" :point width-p :zoom zoom}]]
|
[:& gradient-width-handler-shadow-filter {:id "gradient-width-handler-drop-shadow" :point width-p :zoom zoom}]]
|
||||||
|
|
||||||
[:g {:filter "url(#gradient_line_drop_shadow)"}
|
[:g {:filter "url(#gradient-line-drop-shadow)"}
|
||||||
[:line {:x1 (:x from-p)
|
[:line {:x1 (:x from-p)
|
||||||
:y1 (:y from-p)
|
:y1 (:y from-p)
|
||||||
:x2 (:x to-p)
|
:x2 (:x to-p)
|
||||||
|
@ -188,7 +188,7 @@
|
||||||
:stroke-width (/ gradient-line-stroke-width zoom)}]]
|
:stroke-width (/ gradient-line-stroke-width zoom)}]]
|
||||||
|
|
||||||
(when width-p
|
(when width-p
|
||||||
[:g {:filter "url(#gradient_width_line_drop_shadow)"}
|
[:g {:filter "url(#gradient-width-line-drop-shadow)"}
|
||||||
[:line {:x1 (:x from-p)
|
[:line {:x1 (:x from-p)
|
||||||
:y1 (:y from-p)
|
:y1 (:y from-p)
|
||||||
:x2 (:x width-p)
|
:x2 (:x width-p)
|
||||||
|
@ -197,7 +197,7 @@
|
||||||
:stroke-width (/ gradient-line-stroke-width zoom)}]])
|
:stroke-width (/ gradient-line-stroke-width zoom)}]])
|
||||||
|
|
||||||
(when width-p
|
(when width-p
|
||||||
[:g {:filter "url(#gradient_width_handler_drop_shadow)"}
|
[:g {:filter "url(#gradient-width-handler-drop-shadow)"}
|
||||||
[:circle {:data-allow-click-modal "colorpicker"
|
[:circle {:data-allow-click-modal "colorpicker"
|
||||||
:cx (:x width-p)
|
:cx (:x width-p)
|
||||||
:cy (:y width-p)
|
:cy (:y width-p)
|
||||||
|
@ -208,7 +208,7 @@
|
||||||
|
|
||||||
[:& gradient-color-handler
|
[:& gradient-color-handler
|
||||||
{:selected (or (not editing) (= editing 0))
|
{:selected (or (not editing) (= editing 0))
|
||||||
:filter-id "gradient_square_from_drop_shadow"
|
:filter-id "gradient-square-from-drop-shadow"
|
||||||
:zoom zoom
|
:zoom zoom
|
||||||
:point from-p
|
:point from-p
|
||||||
:color from-color
|
:color from-color
|
||||||
|
@ -219,7 +219,7 @@
|
||||||
|
|
||||||
[:& gradient-color-handler
|
[:& gradient-color-handler
|
||||||
{:selected (= editing 1)
|
{:selected (= editing 1)
|
||||||
:filter-id "gradient_square_to_drop_shadow"
|
:filter-id "gradient-square-to-drop-shadow"
|
||||||
:zoom zoom
|
:zoom zoom
|
||||||
:point to-p
|
:point to-p
|
||||||
:color to-color
|
:color to-color
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue