Add suport to export/import frames with radius

This commit is contained in:
alonso.torres 2022-02-28 18:00:48 +01:00 committed by Alonso Torres
parent d4af28c52b
commit 17fc15138a
10 changed files with 386 additions and 505 deletions

View file

@ -59,8 +59,8 @@
(case (ctr/radius-mode shape)
:radius-1
(obj/merge! attrs #js {:rx (:rx shape)
:ry (:ry shape)})
(obj/merge! attrs #js {:rx (:rx shape 0)
:ry (:ry shape 0)})
:radius-4
(let [[r1 r2 r3 r4] (truncate-radius shape)

View file

@ -63,6 +63,7 @@
"Adds as metadata properties that we cannot deduce from the exported SVG"
[props shape]
(let [add! (add-factory shape)
frame? (= :frame (:type shape))
group? (= :group (:type shape))
rect? (= :rect (:type shape))
image? (= :image (:type shape))
@ -94,7 +95,7 @@
(add! :constraints-v)
(add! :fixed-scroll)
(cond-> (and (or rect? image?) (some? (:r1 shape)))
(cond-> (and (or rect? image? frame?) (some? (:r1 shape)))
(-> (add! :r1)
(add! :r2)
(add! :r3)