From 52d3b2c7fcd0e1fed97571992c7fc1f2782c0235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Sat, 9 Apr 2016 22:06:24 +0200 Subject: [PATCH] The zoom change is relative to the current zoom (#5) --- src/uxbox/data/workspace.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uxbox/data/workspace.cljs b/src/uxbox/data/workspace.cljs index 2c28d59ee7..bf7a529b4a 100644 --- a/src/uxbox/data/workspace.cljs +++ b/src/uxbox/data/workspace.cljs @@ -249,7 +249,7 @@ (defrecord IncreaseZoom [] rs/UpdateEvent (-apply-update [_ state] - (let [increase #(+ % 0.1)] + (let [increase #(* % 1.05)] (update-in state [:workspace :zoom] (fnil increase 1))))) (defn increase-zoom @@ -261,7 +261,7 @@ (defrecord DecreaseZoom [] rs/UpdateEvent (-apply-update [_ state] - (let [decrease #(if (> % 0) (- % 0.1) 0)] + (let [decrease #(* % 0.95)] (update-in state [:workspace :zoom] (fnil decrease 1))))) (defn decrease-zoom