From 49cff5429e5c3331d3f8be7f08828e3b057be175 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 20 Jan 2016 19:25:35 +0200 Subject: [PATCH] Add missing attributes on shape svg rendering. --- src/uxbox/ui/shapes.cljs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/uxbox/ui/shapes.cljs b/src/uxbox/ui/shapes.cljs index 24b8bbab4..51d575038 100644 --- a/src/uxbox/ui/shapes.cljs +++ b/src/uxbox/ui/shapes.cljs @@ -14,14 +14,14 @@ (defn- extract-attrs "Extract predefinet attrs from shapes." [shape] - (select-keys shape [:rotation :width :height - :x :y :opacity :fill :view-box])) + (select-keys shape [:fill :opacity])) (defn- make-debug-attrs - [attrs] - (let [xf (map (fn [[x v]] - [(keyword (str "data-" (name x))) v]))] - (into {} xf attrs))) + [shape] + (let [attrs (select-keys shape [:rotation :width :height :x :y]) + xf (map (fn [[x v]] + [(keyword (str "data-" (name x))) v]))] + (into {} xf attrs))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Implementation @@ -32,10 +32,9 @@ (let [key (str "use-" id) transform (-> (merge shape attrs) (svg/calculate-transform)) - attrs {:id key :key key :transform transform} - attrs (-> (extract-attrs shape) - (make-debug-attrs) - (merge attrs))] + attrs (merge {:id key :key key :transform transform} + (extract-attrs shape) + (make-debug-attrs shape))] (html [:g attrs data])))