 
 ;; animation
 
-(defn now []
-  (System/currentTimeMillis))
-
-(defn animate! [reference value-address duration min-val max-val]
+
+(defn animate!
+  "Slowly alters reference at value-address, linearly
+   with time from min-val to max-val."
+  [reference value-address duration min-val max-val]
   (let [start-time (now)]
     (loop []
       (let [elapsed (- (now) start-time)

       (match-shapes [x y])))

(defn handle-mouse-move [e reference canvas]
  (let [data @reference
        last-widgets-under-mouse ((meta canvas) ::last-widgets-under-mouse)
        widgets-under-mouse (set (map #(select-keys % [:mouse-in :mouse-out :shape]) (mouse-is-over [(.getX e) (.getY e)] data)))
        in (clojure.set/difference widgets-under-mouse last-widgets-under-mouse)
        out (clojure.set/difference last-widgets-under-mouse widgets-under-mouse)]
    (alter-meta! canvas assoc ::last-widgets-under-mouse


;; widgets ;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn update-in-if
  "Like update-in, but only applies the
   function if the keys are present. Otherwise
