       (init-state [_]
         {:mouse-chan (chan)
          :user-is-moving-selection false
+         :selection-was-pasted false
          :selection [0 0 0 0]
          :selection-image {}
          :mouse-offset-in-selection [0 0]})

              [x1 y1 x2 y2] (om/get-state owner :selection)
              paste-x (- doc-x xOff)
              paste-y (- doc-y yOff)
              backfill (create-sub-image-for-rect (om/get-state owner :selection)
                                                  (get-in @app [:tools :paint-color]))]
        (paste-image app owner x1 y1 backfill)
        (paste-image app owner paste-x paste-y (om/get-state owner :selection-image)))
        (clear-selection-state owner)
        (om/transact! app

  (let [clipboard-image (om/get-state owner :clipboard-image)
        paste-rect [0 0 (:width clipboard-image) (:height clipboard-image)]]
    (om/set-state! owner :selection-image clipboard-image)
    (om/set-state! owner :selection paste-rect)
    (om/set-state! owner :selection-was-pasted true)))

(defn handle-command [app owner e]
  (when (= e :copy) (copy app owner e))
