diff --git a/frontend/uxbox/ui/workspace/canvas.cljs b/frontend/uxbox/ui/workspace/canvas.cljs index b2e478700..7b6fae580 100644 --- a/frontend/uxbox/ui/workspace/canvas.cljs +++ b/frontend/uxbox/ui/workspace/canvas.cljs @@ -40,8 +40,7 @@ selection-circle-style {:fillOpacity "0.5" :strokeWidth "1px" - :vectorEffect "non-scaling-stroke" - :cursor "move"}) + :vectorEffect "non-scaling-stroke"}) (def ^:private default-selection-props @@ -73,22 +72,23 @@ (dom/stop-propagation event) (reset! wb/shapes-dragging? false))] (html - [:g {:on-mouse-down on-mouse-down - :on-mouse-up on-mouse-up} + [:g.shape {:class (when selected? "selected") + :on-mouse-down on-mouse-down + :on-mouse-up on-mouse-up} (shapes/render shape) (if selected? - [:g {:class "controls"} + [:g.controls [:rect {:x x :y y :width width :height height :style {:stroke "black" :fill "transparent" :stroke-opacity "0.5"}}] - [:circle (merge default-selection-props - {:cx x :cy y})] - [:circle (merge default-selection-props - {:cx (+ x width) :cy y})] - [:circle (merge default-selection-props - {:cx x :cy (+ y height)})] - [:circle (merge default-selection-props - {:cx (+ x width) :cy (+ y height)})]])])))) + [:circle.top-left (merge default-selection-props + {:cx x :cy y})] + [:circle.top-right (merge default-selection-props + {:cx (+ x width) :cy y})] + [:circle.bottom-left (merge default-selection-props + {:cx x :cy (+ y height)})] + [:circle.bottom-right (merge default-selection-props + {:cx (+ x width) :cy (+ y height)})]])])))) (def shape (util/component @@ -114,23 +114,23 @@ (dom/stop-propagation event) (reset! wb/shapes-dragging? false))] (html - [:g.selected - {:on-mouse-down on-mouse-down - :on-mouse-up on-mouse-up} + [:g {:class "shape selected" + :on-mouse-down on-mouse-down + :on-mouse-up on-mouse-up} (for [item shapes] (shapes/render item)) - [:g {:class "controls"} + [:g.controls [:rect {:x x :y y :width width :height height :style {:stroke "black" :fill "transparent" :stroke-opacity "0.5"}}] - [:circle (merge default-selection-props - {:cx x :cy y})] - [:circle (merge default-selection-props - {:cx (+ x width) :cy y})] - [:circle (merge default-selection-props - {:cx x :cy (+ y height)})] - [:circle (merge default-selection-props - {:cx (+ x width) :cy (+ y height)})]]])))) + [:circle.top-left (merge default-selection-props + {:cx x :cy y})] + [:circle.top-right (merge default-selection-props + {:cx (+ x width) :cy y})] + [:circle.bottom-left (merge default-selection-props + {:cx x :cy (+ y height)})] + [:circle.bottom-right (merge default-selection-props + {:cx (+ x width) :cy (+ y height)})]]])))) (def selected-shapes (util/component diff --git a/resources/public/styles/partials/workspace-canvas.scss b/resources/public/styles/partials/workspace-canvas.scss index 3ee832478..ff642ee47 100644 --- a/resources/public/styles/partials/workspace-canvas.scss +++ b/resources/public/styles/partials/workspace-canvas.scss @@ -14,9 +14,20 @@ &.drawing { cursor: cell; } + + g.shape { + &.selected { + circle.top-left { cursor: nwse-resize; } + circle.bottom-right { cursor: nwse-resize; } + circle.top-right { cursor: nesw-resize; } + circle.bottom-left { cursor: nesw-resize; } + } + } } .viewport, .page-canvas, .page-layout { overflow: visible; } + + }