0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-10 09:08:31 -05:00

Add export/import to custom caps

This commit is contained in:
alonso.torres 2021-08-30 12:12:04 +02:00 committed by Andrés Moya
parent 3cd3e89679
commit 2dfa4f9ec9
2 changed files with 15 additions and 2 deletions

View file

@ -62,6 +62,7 @@
group? (= :group (:type shape))
rect? (= :rect (:type shape))
text? (= :text (:type shape))
path? (= :path (:type shape))
mask? (and group? (:masked-group? shape))
center (gsh/center-shape shape)]
(-> props
@ -92,6 +93,10 @@
(add! :r3)
(add! :r4)))
(cond-> path?
(-> (add! :stroke-cap-start)
(add! :stroke-cap-end)))
(cond-> text?
(-> (add! :grow-type)
(add! :content (comp json/encode uuid->string))))

View file

@ -373,7 +373,9 @@
stroke-alignment (get-meta node :stroke-alignment keyword)
stroke (:stroke svg-data)
gradient (when (str/starts-with? stroke "url")
(parse-gradient node stroke))]
(parse-gradient node stroke))
stroke-cap-start (get-meta node :stroke-cap-start keyword)
stroke-cap-end (get-meta node :stroke-cap-end keyword)]
(cond-> props
:always
@ -389,7 +391,13 @@
:stroke-opacity nil)
(= stroke-alignment :inner)
(update :stroke-width / 2))))
(update :stroke-width / 2)
(some? stroke-cap-start)
(assoc :stroke-cap-start stroke-cap-start)
(some? stroke-cap-end)
(assoc :stroke-cap-end stroke-cap-end))))
(defn add-rect-data
[props node svg-data]