Improved geometry for rects

This commit is contained in:
alonso.torres 2021-02-23 21:26:31 +01:00 committed by Andrey Antukh
parent 23d531a664
commit 94c5004c33
7 changed files with 228 additions and 88 deletions

View file

@ -85,7 +85,8 @@
;; If contains svg-attrs the origin is svg. If it's not svg origin
;; we setup the default fill as transparent (instead of black)
(not (contains? shape :svg-attrs))
(and (not (contains? shape :svg-attrs))
(not (= :svg-raw (:type shape))))
{:fill "transparent"}
:else

View file

@ -84,12 +84,17 @@
(mf/defc svg-defs [{:keys [shape render-id]}]
(let [svg-defs (:svg-defs shape)
_ (when (:svg-transform shape) (.log js/console (str (:svg-transform shape))))
transform (mf/use-memo
(mf/deps shape)
#(if (= :svg-raw (:type shape))
(gmt/matrix)
(usvg/svg-transform-matrix shape)))
;;transform (gmt/multiply
;; transform
;; (:svg-transform shape (gmt/matrix)))
prefix-id
(fn [id]
(cond->> id