0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

🐛 Fix problem with gradient and rotations in booleans

This commit is contained in:
alonso.torres 2024-01-24 14:44:48 +01:00
parent 46b767ab0b
commit 50774bebb3
2 changed files with 8 additions and 9 deletions

View file

@ -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))}])])])))

View file

@ -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)]