diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index 2d03d7ad6..366345735 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -959,8 +959,9 @@ ptk/UpdateEvent (update [_ state] (let [page-id (:current-page-id state)] - (update-in state [:workspace-data page-id :objects id :segments index] - gpt/add delta))))) + (-> state + (update-in [:workspace-data page-id :objects id :segments index] gpt/add delta) + (update-in [:workspace-data page-id :objects id] geom/update-path-selrect)))))) ;; --- Shape attrs (Layers Sidebar) diff --git a/frontend/src/uxbox/main/data/workspace/drawing.cljs b/frontend/src/uxbox/main/data/workspace/drawing.cljs index 3f053f749..91e079435 100644 --- a/frontend/src/uxbox/main/data/workspace/drawing.cljs +++ b/frontend/src/uxbox/main/data/workspace/drawing.cljs @@ -131,8 +131,9 @@ (def handle-drawing-path (letfn [(stoper-event? [{:keys [type shift] :as event}] (or (= event :path/end-path-drawing) + (= event :interrupt) (and (ms/mouse-event? event) - (or (and (= type :double-click) shift) + (or (= type :double-click) (= type :context-menu))) (and (ms/keyboard-event? event) (= type :down) @@ -207,6 +208,7 @@ (rx/concat (->> stream' + (rx/take-until stoper) (rx/map (fn [[point ctrl? index :as xxx]] (let [point (if ctrl? (as-> point $ @@ -214,8 +216,7 @@ (align-position (gpt/angle $) $) (gpt/add $ @last-point)) point)] - #(update-point-segment % index point)))) - (rx/take-until stoper)) + #(update-point-segment % index point))))) (rx/of finish-drawing-path handle-finish-drawing)))))))) diff --git a/frontend/src/uxbox/main/ui/workspace/drawarea.cljs b/frontend/src/uxbox/main/ui/workspace/drawarea.cljs index a0dd0bcfc..beb518a5c 100644 --- a/frontend/src/uxbox/main/ui/workspace/drawarea.cljs +++ b/frontend/src/uxbox/main/ui/workspace/drawarea.cljs @@ -12,6 +12,7 @@ [uxbox.main.data.workspace.drawing :as dd] [uxbox.main.store :as st] [uxbox.main.ui.workspace.shapes :as shapes] + [uxbox.common.geom.shapes :as gsh] [uxbox.util.dom :as dom] [uxbox.util.i18n :as i18n :refer [t]])) @@ -27,7 +28,7 @@ (mf/defc generic-draw-area [{:keys [shape zoom]}] - (let [{:keys [x y width height]} (:selrect shape)] + (let [{:keys [x y width height]} (:selrect (gsh/transform-shape shape))] (when (and x y) [:g [:& shapes/shape-wrapper {:shape shape}] diff --git a/frontend/src/uxbox/main/ui/workspace/selection.cljs b/frontend/src/uxbox/main/ui/workspace/selection.cljs index 645203487..828d6ce2d 100644 --- a/frontend/src/uxbox/main/ui/workspace/selection.cljs +++ b/frontend/src/uxbox/main/ui/workspace/selection.cljs @@ -25,7 +25,8 @@ [uxbox.common.geom.shapes :as geom] [uxbox.common.geom.point :as gpt] [uxbox.common.geom.matrix :as gmt] - [uxbox.util.debug :refer [debug?]])) + [uxbox.util.debug :refer [debug?]] + [uxbox.main.ui.workspace.shapes.outline :refer [outline]])) (def rotation-handler-size 25) @@ -192,6 +193,7 @@ [:& selection-rect {:rect selrect :transform transform :zoom zoom}] + [:& outline {:shape (geom/transform-shape shape)}] ;; Handlers (for [{:keys [type position props]} (handlers-for-selection selrect)] diff --git a/frontend/src/uxbox/main/ui/workspace/shapes/path.cljs b/frontend/src/uxbox/main/ui/workspace/shapes/path.cljs index c6d3d53ad..4990ba691 100644 --- a/frontend/src/uxbox/main/ui/workspace/shapes/path.cljs +++ b/frontend/src/uxbox/main/ui/workspace/shapes/path.cljs @@ -18,6 +18,7 @@ [uxbox.main.ui.keyboard :as kbd] [uxbox.main.ui.shapes.path :as path] [uxbox.main.ui.workspace.shapes.common :as common] + [uxbox.main.data.workspace.drawing :as dr] [uxbox.util.dom :as dom] [uxbox.util.interop :as itr] [uxbox.main.streams :as ms] @@ -37,7 +38,7 @@ on-double-click (mf/use-callback (mf/deps shape) (fn [event] - (when (hover? (:id shape)) + (when (and (not (::dr/initialized? shape)) (hover? (:id shape))) (do (dom/stop-propagation event) (dom/prevent-default event)