From 6d82194f9f2d50b394db090269f6414d0e64bf77 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sat, 9 Jul 2016 21:31:17 +0300 Subject: [PATCH] Convert rect-shape component to use new defc macro. --- src/uxbox/main/ui/shapes/rect.cljs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/uxbox/main/ui/shapes/rect.cljs b/src/uxbox/main/ui/shapes/rect.cljs index 01c15d9fb..b356149d2 100644 --- a/src/uxbox/main/ui/shapes/rect.cljs +++ b/src/uxbox/main/ui/shapes/rect.cljs @@ -9,7 +9,7 @@ [rum.core :as rum] [uxbox.main.ui.shapes.common :as common] [uxbox.main.ui.shapes.attrs :as attrs] - [uxbox.util.mixins :as mx] + [uxbox.util.mixins :as mx :include-macros true] [uxbox.main.geom :as geom] [uxbox.util.dom :as dom])) @@ -38,19 +38,12 @@ ;; --- Rect Shape -(defn- rect-shape-render - [own {:keys [id x1 y1 x2 y2] :as shape}] +(mx/defc rect-shape + [{:keys [id x1 y1 x2 y2] :as shape}] (let [key (str id) rfm (geom/transformation-matrix shape) size (geom/size shape) props {:x x1 :y y1 :id key :key key :transform (str rfm)} attrs (-> (attrs/extract-style-attrs shape) (merge props size))] - (html - [:rect attrs]))) - -(def rect-shape - (mx/component - {:render rect-shape-render - :name "rect-shape" - :mixins [mx/static]})) + [:rect attrs]))