 
   (println render-state)
 
-  (make-canvases-fill-window!)
+  (set-canvas-dimensions!)
 
   (let [max-iterations        (int (* 10 (Math/log scale))) ; Sensible?
         start                 (.getTime (js/Date.))


(set! (.-onmouseup overlay-canvas) handle-mouseup)

(set! (.-onresize js/window) (fn [] (render-mandelbrot! @app-state)))

(add-watch app-state :state-changed
           (fn [_ _ old-state new-state]
             (when-not (= (:rendering-data old-state)
                          (:rendering-data new-state))

               (add-overlay-rectangle!
                0 0
                (aget overlay-canvas "width") (aget overlay-canvas "height")
                :opacity 0.2 :color "green" :clear? true :type :fill)

               (.setTimeout js/window #(render-mandelbrot! new-state) 10))))

(render-mandelbrot! @app-state)


                                          (aget e "pageY")
                                          :clear? true
                                          :color "green"))))

(defn re-render!
  [new-state]
  (add-overlay-rectangle!
   0 0
   (aget overlay-canvas "width") (aget overlay-canvas "height")
   :opacity 0.2 :color "green" :clear? true :type :fill)

  (.setTimeout js/window #(render-mandelbrot! new-state) 50))


(defn zoom-to-enclose-rectangle!
