0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-07 15:39:42 -05:00

Add missing key attr on shape rendering.

This commit is contained in:
Andrey Antukh 2015-12-30 17:00:43 +02:00
parent 95a1bb80df
commit 0b8cc5f964

View file

@ -55,24 +55,25 @@
(select-keys shape [:width :height :view-box :x :y :cx :cy]))
(defmethod -render :builtin/icon
[{:keys [data] :as shape} attrs]
[{:keys [data id] :as shape} attrs]
(let [attrs (as-> shape $
(extract-attrs $)
(remove-nil-vals $)
(merge $ attrs)
(transform-attrs $))]
(html
[:svg attrs data])))
[:svg (merge attrs {:key (str id)})
data])))
(defmethod -render :builtin/icon-svg
[{:keys [image] :as shape} attrs]
[{:keys [image id] :as shape} attrs]
(let [attrs (as-> shape $
(extract-attrs $)
(remove-nil-vals $)
(merge $ attrs)
(transform-attrs $))]
(html
[:svg attrs
[:svg (merge attrs {:key (str id)})
[:image image]])))
(defmethod -move ::shape