🎉 Reimplement canvas as svg (instead of g+rect).

This commit is contained in:
Andrey Antukh 2020-02-18 17:11:17 +01:00
parent 63a339dd31
commit 86ba4fd083
12 changed files with 442 additions and 152 deletions

View file

@ -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)"