From eebd56d738e983bdef07450a6030c17bd3f4e7a2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sat, 24 Aug 2019 12:40:45 +0200 Subject: [PATCH] :lipstick: Cosmetic changes on initial align shape event. --- frontend/src/uxbox/main/data/workspace.cljs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index 17a3f00b0..befb70eb1 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -582,20 +582,19 @@ ;; --- Shape Transformations -(defrecord InitialShapeAlign [id] - ptk/WatchEvent - (watch [_ state s] - (let [{:keys [x1 y1] :as shape} (->> (get-in state [:shapes id]) - (geom/shape->rect-shape state)) - point (gpt/point x1 y1)] - (->> (uwrk/align-point point) - (rx/map (fn [{:keys [x y] :as pt}] - (apply-temporal-displacement id (gpt/subtract pt point)))))))) - (defn initial-shape-align [id] {:pre [(uuid? id)]} - (InitialShapeAlign. id)) + (reify + ptk/WatchEvent + (watch [_ state s] + (let [{:keys [x1 y1] :as shape} (->> (get-in state [:shapes id]) + (geom/shape->rect-shape state)) + point (gpt/point x1 y1)] + (->> (uwrk/align-point point) + (rx/map (fn [{:keys [x y] :as pt}] + (apply-temporal-displacement id (gpt/subtract pt point))))))))) + ;; --- Apply Temporal Displacement