 (defrecord IncreaseZoom []
   rs/UpdateEvent
   (-apply-update [_ state]
-    (let [increase #(min (mth/precision (* % 1.05) 2) 3)]
+    (let [increase #(nth zoom-levels (+ (index-of zoom-levels %) 1) (last zoom-levels))]
       (update-in state [:workspace :zoom] (fnil increase 1)))))
 
 (defn increase-zoom

(defrecord DecreaseZoom []
  rs/UpdateEvent
  (-apply-update [_ state]
    (let [decrease #(max (mth/precision (* % 0.95) 2) 0.15)]
      (update-in state [:workspace :zoom] (fnil decrease 1)))))

(defn decrease-zoom

            [uxbox.data.shapes :as uds]
            [uxbox.util.datetime :as dt]
            [uxbox.util.math :as mth]
            [uxbox.util.data :refer (index-of)]
            [uxbox.util.geom.point :as gpt]
            [uxbox.util.workers :as uw]))

;; --- Initialize Workspace

(declare initialize-alignment-index)

(defonce zoom-levels [0.20 0.21 0.22 0.23 0.24 0.25 0.27 0.28 0.30 0.32 0.34
                      0.36 0.38 0.40 0.42 0.44 0.46 0.48 0.51 0.54 0.57 0.60
                      0.63 0.66 0.69 0.73 0.77 0.81 0.85 0.90 0.95 1.00 1.05
                      1.10 1.15 1.21 1.27 1.33 1.40 1.47 1.54 1.62 1.70 1.78
                      1.87 1.96 2.06 2.16 2.27 2.38 2.50 2.62 2.75 2.88 3.00])

(defrecord InitializeWorkspace [project page]
  rs/UpdateEvent
