mirror of
https://github.com/penpot/penpot.git
synced 2025-05-25 04:46:11 +02:00
✨ Add export/import to custom caps
This commit is contained in:
parent
3cd3e89679
commit
2dfa4f9ec9
2 changed files with 15 additions and 2 deletions
|
@ -62,6 +62,7 @@
|
||||||
group? (= :group (:type shape))
|
group? (= :group (:type shape))
|
||||||
rect? (= :rect (:type shape))
|
rect? (= :rect (:type shape))
|
||||||
text? (= :text (:type shape))
|
text? (= :text (:type shape))
|
||||||
|
path? (= :path (:type shape))
|
||||||
mask? (and group? (:masked-group? shape))
|
mask? (and group? (:masked-group? shape))
|
||||||
center (gsh/center-shape shape)]
|
center (gsh/center-shape shape)]
|
||||||
(-> props
|
(-> props
|
||||||
|
@ -92,6 +93,10 @@
|
||||||
(add! :r3)
|
(add! :r3)
|
||||||
(add! :r4)))
|
(add! :r4)))
|
||||||
|
|
||||||
|
(cond-> path?
|
||||||
|
(-> (add! :stroke-cap-start)
|
||||||
|
(add! :stroke-cap-end)))
|
||||||
|
|
||||||
(cond-> text?
|
(cond-> text?
|
||||||
(-> (add! :grow-type)
|
(-> (add! :grow-type)
|
||||||
(add! :content (comp json/encode uuid->string))))
|
(add! :content (comp json/encode uuid->string))))
|
||||||
|
|
|
@ -373,7 +373,9 @@
|
||||||
stroke-alignment (get-meta node :stroke-alignment keyword)
|
stroke-alignment (get-meta node :stroke-alignment keyword)
|
||||||
stroke (:stroke svg-data)
|
stroke (:stroke svg-data)
|
||||||
gradient (when (str/starts-with? stroke "url")
|
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
|
(cond-> props
|
||||||
:always
|
:always
|
||||||
|
@ -389,7 +391,13 @@
|
||||||
:stroke-opacity nil)
|
:stroke-opacity nil)
|
||||||
|
|
||||||
(= stroke-alignment :inner)
|
(= 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
|
(defn add-rect-data
|
||||||
[props node svg-data]
|
[props node svg-data]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue