diff --git a/src/uxbox/ui/workspace.cljs b/src/uxbox/ui/workspace.cljs index cf1226b09..401ee43b7 100644 --- a/src/uxbox/ui/workspace.cljs +++ b/src/uxbox/ui/workspace.cljs @@ -111,7 +111,7 @@ (defn- workspace-render [own projectid] - (let [{:keys [flags] :as workspace} (rum/react uuwb/workspace-l) + (let [{:keys [flags zoom] :as workspace} (rum/react uuwb/workspace-l) left-sidebar? (not (empty? (keep flags [:layers :sitemap :document-history]))) right-sidebar? (not (empty? (keep flags [:icons :drawtools @@ -131,8 +131,8 @@ [:section.workspace-content {:class classes :on-scroll on-scroll} ;; Rules - (horizontal-rule) - (vertical-rule) + (horizontal-rule zoom) + (vertical-rule zoom) ;; Canvas [:section.workspace-canvas {:ref "workspace-canvas"} diff --git a/src/uxbox/ui/workspace/canvas.cljs b/src/uxbox/ui/workspace/canvas.cljs index 883280c8e..5e869f944 100644 --- a/src/uxbox/ui/workspace/canvas.cljs +++ b/src/uxbox/ui/workspace/canvas.cljs @@ -73,7 +73,6 @@ (when (contains? flags :grid) (grid 1))]))) - (def canvas (mx/component {:render canvas-render @@ -89,7 +88,7 @@ (let [workspace (rum/react uuwb/workspace-l) page (rum/react uuwb/page-l) drawing? (:drawing workspace) - zoom 1] + zoom (:zoom workspace 1)] (letfn [(on-mouse-down [event] (dom/stop-propagation event) (when-not (empty? (:selected workspace)) @@ -110,9 +109,9 @@ :on-mouse-up on-mouse-up} [:g.zoom {:transform (str "scale(" zoom ", " zoom ")")} (if page - (canvas page)) + (canvas page))] (ruler) - (selrect)]])))) + (selrect)])))) (defn- viewport-did-mount [own] diff --git a/src/uxbox/ui/workspace/shortcuts.cljs b/src/uxbox/ui/workspace/shortcuts.cljs index e72ff55bb..9b0dd2d14 100644 --- a/src/uxbox/ui/workspace/shortcuts.cljs +++ b/src/uxbox/ui/workspace/shortcuts.cljs @@ -33,6 +33,9 @@ :ctrl+shift+f #(rs/emit! (dw/toggle-flag :drawtools)) :ctrl+shift+i #(rs/emit! (dw/toggle-flag :icons)) :ctrl+shift+l #(rs/emit! (dw/toggle-flag :layers)) + :ctrl+p #(rs/emit! (dw/increase-zoom)) + :ctrl+m #(rs/emit! (dw/decrease-zoom)) + :ctrl+l #(rs/emit! (dw/reset-zoom)) :ctrl+r #(rs/emit! (dw/toggle-flag :ruler)) :ctrl+d #(rs/emit! (dw/duplicate-selected)) :ctrl+c #(rs/emit! (dw/copy-to-clipboard))