From 13e867971309fff8814cba818496b72851cfeeb5 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 22 Aug 2016 17:32:41 +0300 Subject: [PATCH] Return to previous path drawing method. --- src/uxbox/main/ui/shapes/path.cljs | 2 +- src/uxbox/main/ui/workspace/drawarea.cljs | 22 +++++++++++----------- src/uxbox/util/geom/point.cljs | 1 - 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/uxbox/main/ui/shapes/path.cljs b/src/uxbox/main/ui/shapes/path.cljs index c5ca94a04..a3a632392 100644 --- a/src/uxbox/main/ui/shapes/path.cljs +++ b/src/uxbox/main/ui/shapes/path.cljs @@ -43,5 +43,5 @@ attrs (-> (attrs/extract-style-attrs shape) (merge {:id key :key key :d (render-path shape)}) (merge (when-not drawing? - {:transform (str rfm)})))] + #_{:transform (str rfm)})))] [:path attrs])) diff --git a/src/uxbox/main/ui/workspace/drawarea.cljs b/src/uxbox/main/ui/workspace/drawarea.cljs index 877c00d79..8f16a3314 100644 --- a/src/uxbox/main/ui/workspace/drawarea.cljs +++ b/src/uxbox/main/ui/workspace/drawarea.cljs @@ -133,18 +133,18 @@ maxx (apply max (map :x points)) maxy (apply max (map :y points)) - dx (- 0 minx) - dy (- 0 miny) - points (mapv #(gpt/add % [dx dy]) points) + ;; dx (- 0 minx) + ;; dy (- 0 miny) + ;; points (mapv #(gpt/add % [dx dy]) points) width (- maxx minx) height (- maxy miny)] (assoc shape - :x1 minx - :y1 miny - :x2 maxx - :y2 maxy - :view-box [0 0 width height] + ;; :x1 minx + ;; :y1 miny + ;; :x2 maxx + ;; :y2 maxy + ;; :view-box [0 0 width height] :points points))) (on-first-point [point] @@ -193,10 +193,10 @@ maxx (apply max (map :x points)) maxy (apply max (map :y points)) - dx (- 0 minx) - dy (- 0 miny) + ;; dx (- 0 minx) + ;; dy (- 0 miny) ;; _ (println "Initial number of points:" (count points)) - points (mapv #(gpt/add % [dx dy]) points) + ;; points (mapv #(gpt/add % [dx dy]) points) points (path/simplify points 0.1) ;; _ (println "Final number of points:" (count points)) width (- maxx minx) diff --git a/src/uxbox/util/geom/point.cljs b/src/uxbox/util/geom/point.cljs index 2912a7775..f5258bbf7 100644 --- a/src/uxbox/util/geom/point.cljs +++ b/src/uxbox/util/geom/point.cljs @@ -159,7 +159,6 @@ (Point. (mth/precision x decimanls) (mth/precision y decimanls))) - (defn transform "Transform a point applying a matrix transfomation." [{:keys [x y] :as p} {:keys [a b c d tx ty] :as m}]