Gradients support in shapes

This commit is contained in:
alonso.torres 2020-10-09 12:29:35 +02:00
parent 381aef77ee
commit c266f78d1e
14 changed files with 176 additions and 79 deletions

View file

@ -27,9 +27,7 @@
{:keys [id x y width height]} shape
transform (geom/transform-matrix shape)
gradient-id (when (:fill-color-gradient shape) (str (uuid/next)))
props (-> (attrs/extract-style-attrs shape gradient-id)
props (-> (attrs/extract-style-attrs shape)
(obj/merge!
#js {:x x
:y y
@ -38,12 +36,6 @@
:width width
:height height}))]
[:*
(when gradient-id
[:& gradient {:id gradient-id
:shape shape
:gradient (:fill-color-gradient shape)}])
[:& shape-custom-stroke {:shape shape
:base-props props
:elem-name "rect"}]]))
[:& shape-custom-stroke {:shape shape
:base-props props
:elem-name "rect"}]))