mirror of
https://github.com/penpot/penpot.git
synced 2025-05-29 18:06:10 +02:00
Add missing attributes on shape svg rendering.
This commit is contained in:
parent
a832bf89b4
commit
49cff5429e
1 changed files with 9 additions and 10 deletions
|
@ -14,14 +14,14 @@
|
||||||
(defn- extract-attrs
|
(defn- extract-attrs
|
||||||
"Extract predefinet attrs from shapes."
|
"Extract predefinet attrs from shapes."
|
||||||
[shape]
|
[shape]
|
||||||
(select-keys shape [:rotation :width :height
|
(select-keys shape [:fill :opacity]))
|
||||||
:x :y :opacity :fill :view-box]))
|
|
||||||
|
|
||||||
(defn- make-debug-attrs
|
(defn- make-debug-attrs
|
||||||
[attrs]
|
[shape]
|
||||||
(let [xf (map (fn [[x v]]
|
(let [attrs (select-keys shape [:rotation :width :height :x :y])
|
||||||
[(keyword (str "data-" (name x))) v]))]
|
xf (map (fn [[x v]]
|
||||||
(into {} xf attrs)))
|
[(keyword (str "data-" (name x))) v]))]
|
||||||
|
(into {} xf attrs)))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Implementation
|
;; Implementation
|
||||||
|
@ -32,10 +32,9 @@
|
||||||
(let [key (str "use-" id)
|
(let [key (str "use-" id)
|
||||||
transform (-> (merge shape attrs)
|
transform (-> (merge shape attrs)
|
||||||
(svg/calculate-transform))
|
(svg/calculate-transform))
|
||||||
attrs {:id key :key key :transform transform}
|
attrs (merge {:id key :key key :transform transform}
|
||||||
attrs (-> (extract-attrs shape)
|
(extract-attrs shape)
|
||||||
(make-debug-attrs)
|
(make-debug-attrs shape))]
|
||||||
(merge attrs))]
|
|
||||||
(html
|
(html
|
||||||
[:g attrs data])))
|
[:g attrs data])))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue