     (.stroke context)
     (.restore context)))
 
-(defn square [[[x0 y0] [x1 y1]]]
+(defn rectangle [[[x0 y0] [x1 y1]]]
   [[x0 y0] [x1 y0] [x1 y1] [x0 y1]])
 
-(defrecord SquareAction [points props]
+(defrecord RectangleAction [points props]
   Drawable
   (-draw [this context]
     (.save context)

               (dom/button #js {:disabled (= (om/value (:current tools)) :line)
                                :onClick (fn [e]
                                           (om/update! tools [:current] :line))} "Line")
               (dom/button #js {:disabled (= (om/value (:current tools)) :square)
                                :onClick (fn [e]
                                           (om/update! tools [:current] :square))} "Square")
               (dom/button #js {:disabled (= (om/value (:current tools)) :circle)
                                :onClick (fn [e]
                                           (om/update! tools [:current] :circle))} "Circle")

    (-end [_ actions]
      actions)))

(def rectangle-tool
  (reify
    ITool
    (-start [_ actions]
      (conj actions (new-rectangle-action)))
    (-move [_ action x y]
      (let [points (next-point (:points action) x y identity)]
        (assoc action :points points)))
