mirror of
https://github.com/penpot/penpot.git
synced 2025-07-28 00:47:19 +02:00
🚧 Start working on shape rotation (with mouse handlers).
This commit is contained in:
parent
747213dea3
commit
338a0b97ac
4 changed files with 89 additions and 36 deletions
|
@ -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]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue