     (.beginPath context)
     (let [[x0 y0] (first points)]
       (.moveTo context x0 y0)
-      (doseq [[x y] (square points)]
+      (doseq [[x y] (rectangle points)]
         (.lineTo context x y))
       (.lineTo context x0 y0))
     (.stroke context)

(defn new-line-action []
  (->LineAction [] (merge {:lineCap "round"
                           :lineJoin "round"} (get-in @app-state [:tools :props]))))
(defn new-square-action []
  (->SquareAction [] (merge {:lineCap "round"
                             :lineJoin "round"} (get-in @app-state [:tools :props]))))
(defn new-circle-action []
  (->CircleAction nil 0 (get-in @app-state [:tools :props])))

    (.stroke context)
    (.restore context)))

(defn rectangle [[[x0 y0] [x1 y1]]]
  [[x0 y0] [x1 y0] [x1 y1] [x0 y1]])

(defrecord RectangleAction [points props]
  Drawable
  (-draw [this context]
    (.save context)
