🎉 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

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