From 5a30c5e584d427b6b017ed9ad23a07fe572bbc8c Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 25 Mar 2024 09:20:12 +0100 Subject: [PATCH] :bug: Fix problem with gradient fill text --- frontend/src/app/main/ui/shapes/shape.cljs | 7 +++++-- frontend/src/app/main/ui/shapes/text/svg_text.cljs | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/shapes/shape.cljs b/frontend/src/app/main/ui/shapes/shape.cljs index 47b32bf52..cbda63671 100644 --- a/frontend/src/app/main/ui/shapes/shape.cljs +++ b/frontend/src/app/main/ui/shapes/shape.cljs @@ -121,7 +121,10 @@ [:& 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-shadows :filter-id (dm/fmt "filter-blur-%" 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}] + + ;; Text fills need to be defined afterwards because they are specified per text-block + (when-not (cfh/text-shape? shape) + [:& fills/fills {:shape shape :render-id render-id}])] children]])) diff --git a/frontend/src/app/main/ui/shapes/text/svg_text.cljs b/frontend/src/app/main/ui/shapes/text/svg_text.cljs index bb5fe3e0c..20c8e8edc 100644 --- a/frontend/src/app/main/ui/shapes/text/svg_text.cljs +++ b/frontend/src/app/main/ui/shapes/text/svg_text.cljs @@ -13,6 +13,7 @@ [app.main.ui.context :as muc] [app.main.ui.shapes.attrs :as attrs] [app.main.ui.shapes.custom-stroke :refer [shape-custom-strokes]] + [app.main.ui.shapes.fills :as fills] [app.main.ui.shapes.gradients :as grad] [app.util.object :as obj] [rumext.v2 :as mf])) @@ -103,5 +104,9 @@ render-id (dm/str render-id "-" index)] [:& (mf/provider muc/render-id) {:key index :value render-id} + ;; Text fills definition. Need to be defined per-text block + [:defs + [:& fills/fills {:shape shape :render-id render-id}]] + [:& shape-custom-strokes {:shape shape :position index :render-id render-id} [:> :text props (:text data)]]]))]]))