diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index 7fb531b32..f3eb7d255 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -1414,14 +1414,15 @@ (us/verify ::us/uuid id) (us/verify ::position position) (ptk/reify ::update-position - IUpdateGroup - (get-ids [_] [id]) - - ptk/UpdateEvent - (update [_ state] - (let [page-id (:current-page-id state)] - (update-in state [:workspace-data page-id :objects id] - geom/absolute-move position))))) + ptk/WatchEvent + (watch [_ state stream] + (let [page-id (:current-page-id state) + shape (get-in state [:workspace-data page-id :objects id]) + current-position (gpt/point (:x shape) (:y shape)) + position (gpt/point (or (:x position) (:x shape)) (or (:y position) (:y shape))) + displacement (gmt/translate-matrix (gpt/subtract position current-position))] + (rx/of (transforms/set-modifiers [id] {:displacement displacement}) + (transforms/apply-modifiers [id])))))) ;; --- Path Modifications @@ -1744,6 +1745,7 @@ (def start-move-selected transforms/start-move-selected) (def move-selected transforms/move-selected) +(def set-rotation transforms/set-rotation) (def set-modifiers transforms/set-modifiers) (def apply-modifiers transforms/apply-modifiers) diff --git a/frontend/src/uxbox/main/data/workspace/transforms.cljs b/frontend/src/uxbox/main/data/workspace/transforms.cljs index 9a1c6ea49..3ff95c23c 100644 --- a/frontend/src/uxbox/main/data/workspace/transforms.cljs +++ b/frontend/src/uxbox/main/data/workspace/transforms.cljs @@ -313,3 +313,4 @@ (let [page-id (:current-page-id state)] (rx/of (common/diff-and-commit-changes page-id) (common/rehash-shape-frame-relationship ids)))))) + diff --git a/frontend/src/uxbox/main/ui/workspace/sidebar/options/measures.cljs b/frontend/src/uxbox/main/ui/workspace/sidebar/options/measures.cljs index 7241a8692..6d2d46028 100644 --- a/frontend/src/uxbox/main/ui/workspace/sidebar/options/measures.cljs +++ b/frontend/src/uxbox/main/ui/workspace/sidebar/options/measures.cljs @@ -67,7 +67,8 @@ (let [value (-> (dom/get-target event) (dom/get-value) (d/parse-integer 0))] - (st/emit! (udw/update-shape (:id shape) {:rotation value})))) + (st/emit! (udw/set-rotation (- value (:rotation shape)) [shape]) + (udw/apply-modifiers #{(:id shape)})))) on-radius-change (fn [event]