mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 04:02:01 +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
|
@ -33,13 +33,14 @@
|
|||
|
||||
(mf/defc image-shape
|
||||
[{:keys [shape] :as props}]
|
||||
(let [{:keys [id rotation modifier-mtx metadata]} 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 [x y width height]} shape
|
||||
{:keys [id x y width height rotation metadata]} shape
|
||||
|
||||
transform (when (and rotation (pos? rotation))
|
||||
(str/format "rotate(%s %s %s)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue