mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
✨ Enable line caps in component sync and svg upload
This commit is contained in:
parent
eb40297a35
commit
3dffb9c8a0
4 changed files with 22 additions and 7 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue