From 50774bebb390fdb1eb4d33307830a1f219a67f22 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 24 Jan 2024 14:44:48 +0100 Subject: [PATCH] :bug: Fix problem with gradient and rotations in booleans --- frontend/src/app/main/ui/shapes/bool.cljs | 15 +++++++-------- frontend/src/app/main/ui/shapes/fills.cljs | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/main/ui/shapes/bool.cljs b/frontend/src/app/main/ui/shapes/bool.cljs index 7f378244f1..29308eebab 100644 --- a/frontend/src/app/main/ui/shapes/bool.cljs +++ b/frontend/src/app/main/ui/shapes/bool.cljs @@ -18,19 +18,19 @@ (mf/fnc bool-shape {::mf/wrap-props false} [props] - (let [shape (unchecked-get props "shape") - children (unchecked-get props "childs") - children (h/use-equal-memo children) + (let [shape (unchecked-get props "shape") + child-objs (unchecked-get props "childs") + child-objs (h/use-equal-memo child-objs) metadata? (mf/use-ctx use/include-metadata-ctx) - content (mf/with-memo [shape children] + content (mf/with-memo [shape child-objs] (let [content (:bool-content shape)] (cond (some? content) content - (some? children) - (gsh/calc-bool-content shape children)))) + (some? child-objs) + (gsh/calc-bool-content shape child-objs)))) shape (mf/with-memo [shape content] (assoc shape :content content))] @@ -40,9 +40,8 @@ [:& path-shape {:shape shape}]) (when metadata? - ;; FIXME: get children looks wrong [:> "penpot:bool" {} - (for [item (map #(get children %) (:shapes shape))] + (for [item (map #(get child-objs %) (:shapes shape))] [:& shape-wrapper {:shape item :key (dm/str (dm/get-prop item :id))}])])]))) diff --git a/frontend/src/app/main/ui/shapes/fills.cljs b/frontend/src/app/main/ui/shapes/fills.cljs index 0abc32400e..518222bcff 100644 --- a/frontend/src/app/main/ui/shapes/fills.cljs +++ b/frontend/src/app/main/ui/shapes/fills.cljs @@ -58,7 +58,7 @@ :width width :height height} - pat-props (if (= :path type) + pat-props (if (or (= :path type) (= :bool type)) (obj/set! pat-props "patternTransform" transform) pat-props)]