Enable line caps in component sync and svg upload

This commit is contained in:
Andrés Moya 2021-08-20 15:48:10 +02:00 committed by Andrey Antukh
parent eb40297a35
commit 3dffb9c8a0
4 changed files with 22 additions and 7 deletions

View file

@ -125,20 +125,20 @@
;; for inner or outer strokes.
(and (spec/stroke-caps-line (:stroke-cap-start shape))
(= (:stroke-cap-start shape) (:stroke-cap-end shape))
(= (:stroke-alignment shape) :center))
(not (#{:inner :outer} (:stroke-alignment shape))))
(assoc :strokeLinecap (:stroke-cap-start shape))
;; For other cap types we use markers.
(and (or (spec/stroke-caps-marker (:stroke-cap-start shape))
(and (spec/stroke-caps-line (:stroke-cap-start shape))
(not= (:stroke-cap-start shape) (:stroke-cap-end shape))))
(= (:stroke-alignment shape) :center))
(not (#{:inner :outer} (:stroke-alignment shape))))
(assoc :markerStart (str "url(#marker-" render-id "-" (name (:stroke-cap-start shape))))
(and (or (spec/stroke-caps-marker (:stroke-cap-end shape))
(and (spec/stroke-caps-line (:stroke-cap-end shape))
(not= (:stroke-cap-start shape) (:stroke-cap-end shape))))
(= (:stroke-alignment shape) :center))
(not (#{:inner :outer} (:stroke-alignment shape))))
(assoc :markerEnd (str "url(#marker-" render-id "-" (name (:stroke-cap-end shape)))))]
(obj/merge! attrs (clj->js stroke-attrs)))