Allows rotation for shapes

This commit is contained in:
alonso.torres 2020-12-22 17:44:51 +01:00
parent 5636881463
commit 84007e6ad1
10 changed files with 105 additions and 49 deletions

View file

@ -13,7 +13,6 @@
[rumext.alpha :as mf]
[app.main.ui.shapes.attrs :as attrs]
[app.main.ui.shapes.custom-stroke :refer [shape-custom-stroke]]
[app.common.geom.shapes :as geom]
[app.util.object :as obj]
[app.util.geom.path :as ugp]))
@ -24,14 +23,11 @@
[props]
(let [shape (unchecked-get props "shape")
background? (unchecked-get props "background?")
;; {:keys [id x y width height]} (geom/shape->rect-shape shape)
{:keys [id x y width height]} (:selrect shape)
transform (geom/transform-matrix shape)
pdata (ugp/content->path (:content shape))
props (-> (attrs/extract-style-attrs shape)
(obj/merge!
#js {:transform transform
:d pdata}))]
#js {:d pdata}))]
(if background?
[:g
[:path {:stroke "transparent"