mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 03:31:38 +02:00
🎉 Reimplement canvas as svg (instead of g+rect).
This commit is contained in:
parent
63a339dd31
commit
86ba4fd083
12 changed files with 442 additions and 152 deletions
|
@ -61,14 +61,14 @@
|
|||
|
||||
(mf/defc path-shape
|
||||
[{:keys [shape background?] :as props}]
|
||||
(let [modifier-mtx (:modifier-mtx shape)
|
||||
rotation (:rotation shape)
|
||||
(let [ds-modifier (:displacement-modifier shape)
|
||||
rz-modifier (:resize-modifier shape)
|
||||
|
||||
shape (cond
|
||||
(gmt/matrix? modifier-mtx) (geom/transform shape modifier-mtx)
|
||||
:else shape)
|
||||
shape (cond-> shape
|
||||
(gmt/matrix? rz-modifier) (geom/transform rz-modifier)
|
||||
(gmt/matrix? ds-modifier) (geom/transform ds-modifier))
|
||||
|
||||
{:keys [id x y width height]} (geom/shape->rect-shape shape)
|
||||
{:keys [id x y width height rotation]} (geom/shape->rect-shape shape)
|
||||
|
||||
transform (when (and rotation (pos? rotation))
|
||||
(str/format "rotate(%s %s %s)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue