 (def canvas nil)
 (def ctx nil)
 
+(defn resize-canvas!
+  [columns]
+  (aset canvas "height" (* 22 size))
+  (aset canvas "width" (* columns size))
+  )
+
 (defn init-canvas!
   [id]
   (set! canvas (.getElementById js/document id))
   (set! ctx (.getContext canvas "2d"))
-  (aset canvas "height" (* 22 size))
-  (aset canvas "width" (* 400 size))
-  (.scale ctx size size))
+  )
 
 (defn draw-state!
   [i s]
+
   (js/console.log i (:drop-y s) (:height s) (pr-str (:collapsed s)))
   (aset ctx "fillStyle" back-color)
   (.fillRect ctx i 0 1 22)

(ns client.game.history
  )

(def size 5)



(defn draw-history!
  [history]

  (let [columns (count history)]
    (if (not= columns prev-columns)
      (resize-canvas! columns))
    (set! prev-columns columns))

  (.scale ctx size size)
  (doseq [[i s] (map-indexed vector history)]
    (draw-state! i s))
  (.setTransform ctx 1 0 0 1 0 0)
  )
