🚧 Start working on shape rotation (with mouse handlers).

This commit is contained in:
Andrey Antukh 2020-01-15 00:15:23 +01:00
parent 747213dea3
commit 338a0b97ac
4 changed files with 89 additions and 36 deletions

View file

@ -49,17 +49,21 @@
{:keys [x y width height]} shape
transform (when (pos? rotation)
(str (rotate (gmt/matrix) shape)))
;; transform (when (pos? rotation)
;; (str (rotate (gmt/matrix) shape)))
moving? (boolean modifier-mtx)
transform (str/format "rotate(%s %s %s)"
rotation
(+ x (/ width 2))
(+ y (/ height 2)))
props (-> (attrs/extract-style-attrs shape)
(assoc :x x
:y y
;; :transform transform
:id (str "shape-" id)
:className (classnames :move-cursor moving?)
:width width
:height height
:transform transform))]
;; :transform transform
))]
[:& "rect" props]))