diff --git a/src/uxbox/shapes.cljs b/src/uxbox/shapes.cljs index f1c03f9990..f424435966 100644 --- a/src/uxbox/shapes.cljs +++ b/src/uxbox/shapes.cljs @@ -72,7 +72,7 @@ dispatch-by-type :hierarchy #'+hierarchy+) -(defmulti -transformation +(defmulti transformation dispatch-by-type :hierarchy #'+hierarchy+) @@ -281,7 +281,7 @@ [shape _] (throw (ex-info "Not implemented (outer-rect')" (select-keys shape [:type])))) -(defmethod -transformation :builtin/icon +(defmethod transformation :builtin/icon [{:keys [x1 y1 rotation view-box] :or {rotation 0} :as shape}] (let [{:keys [width height]} (size shape) orig-width (nth view-box 2) @@ -297,7 +297,7 @@ (gmt/translate (- center-x) (- center-y)) (gmt/scale scale-x scale-y)))) -(defmethod -transformation :builtin/rect +(defmethod transformation :builtin/rect [{:keys [x1 y1 rotation] :or {rotation 0} :as shape}] (let [{:keys [width height]} (size shape) center-x (+ x1 (/ width 2)) @@ -308,7 +308,7 @@ (gmt/translate (- center-x) (- center-y))))) -(defmethod -transformation :builtin/text +(defmethod transformation :builtin/text [{:keys [x1 y1 rotation] :or {rotation 0} :as shape}] (let [{:keys [width height]} (size shape) center-x (+ x1 (/ width 2)) @@ -319,7 +319,7 @@ (gmt/translate (- center-x) (- center-y))))) -(defmethod -transformation :builtin/circle +(defmethod transformation :builtin/circle [{:keys [cx cy rx ry rotation] :or {rotation 0} :as shape}] (-> (gmt/matrix) (gmt/translate cx cy) @@ -328,7 +328,7 @@ (declare outer-rect) -(defmethod -transformation :builtin/group +(defmethod transformation :builtin/group [{:keys [dx dy rotation items] :or {rotation 0} :as shape}] (let [shapes-by-id (get @st/state :shapes-by-id) shapes (map #(get shapes-by-id %) items) @@ -341,9 +341,9 @@ (gmt/rotate rotation) (gmt/translate (- center-x) (- center-y))))) -(defmethod -transformation :default +(defmethod transformation :default [shape _] - (throw (ex-info "Not implemented (-transformation)" (select-keys shape [:type])))) + (throw (ex-info "Not implemented (transformation)" (select-keys shape [:type])))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Helpers diff --git a/src/uxbox/ui/shapes/circle.cljs b/src/uxbox/ui/shapes/circle.cljs index b72cec5d37..3e5bc94ec1 100644 --- a/src/uxbox/ui/shapes/circle.cljs +++ b/src/uxbox/ui/shapes/circle.cljs @@ -15,7 +15,7 @@ (defmethod uusc/render-shape :builtin/circle [{:keys [id] :as shape}] (let [key (str id) - rfm (ush/-transformation shape) + rfm (ush/transformation shape) props (select-keys shape [:cx :cy :rx :ry]) attrs (-> (uusc/extract-style-attrs shape) (merge {:id key :key key :transform (str rfm)}) diff --git a/src/uxbox/ui/shapes/group.cljs b/src/uxbox/ui/shapes/group.cljs index 4ed209c315..a8a03f8e8b 100644 --- a/src/uxbox/ui/shapes/group.cljs +++ b/src/uxbox/ui/shapes/group.cljs @@ -15,7 +15,7 @@ (defmethod uusc/render-shape :builtin/group [{:keys [items id dx dy rotation] :as shape} factory] (let [key (str "group-" id) - rfm (ush/-transformation shape) + rfm (ush/transformation shape) attrs (merge {:id key :key key :transform (str rfm)} (uusc/extract-style-attrs shape) (uusc/make-debug-attrs shape)) diff --git a/src/uxbox/ui/shapes/icon.cljs b/src/uxbox/ui/shapes/icon.cljs index 6fcc0541cb..bf393d5c52 100644 --- a/src/uxbox/ui/shapes/icon.cljs +++ b/src/uxbox/ui/shapes/icon.cljs @@ -117,7 +117,7 @@ (defmethod uusc/render-shape :builtin/icon [{:keys [data id] :as shape} _] (let [key (str id) - rfm (sh/-transformation shape) + rfm (sh/transformation shape) attrs (merge {:id key :key key :transform (str rfm)} (uusc/extract-style-attrs shape) (uusc/make-debug-attrs shape))] diff --git a/src/uxbox/ui/shapes/rect.cljs b/src/uxbox/ui/shapes/rect.cljs index b461c88078..7fb7a12817 100644 --- a/src/uxbox/ui/shapes/rect.cljs +++ b/src/uxbox/ui/shapes/rect.cljs @@ -15,7 +15,7 @@ (defmethod uusc/render-shape :builtin/rect [{:keys [id x1 y1 x2 y2] :as shape}] (let [key (str id) - rfm (ush/-transformation shape) + rfm (ush/transformation shape) size (ush/size shape) props {:x x1 :y y1 :id key :key key :transform (str rfm)} attrs (-> (uusc/extract-style-attrs shape) diff --git a/src/uxbox/ui/shapes/text.cljs b/src/uxbox/ui/shapes/text.cljs index f9d2916895..cdffa65e70 100644 --- a/src/uxbox/ui/shapes/text.cljs +++ b/src/uxbox/ui/shapes/text.cljs @@ -135,7 +135,7 @@ (defmethod uusc/render-shape :builtin/text [{:keys [id x1 y1 x2 y2 content drawing? editing?] :as shape}] (let [key (str id) - rfm (ush/-transformation shape) + rfm (ush/transformation shape) size (ush/size shape) props {:x x1 :y y1 :transform (str rfm)}