                   (let [result (prepare-change id existing-objs delta)
                         result (if (vector? result) result [result])]
                     (recur
-                     (reduce conj existing-objs (map (fn [item] {(:id item) (:obj item)}) result))
+                     (reduce #(assoc %1 (:id %2) (:obj %2)) existing-objs result)
                      (into chgs result)
                      (first ids)
                      (rest ids)))))))

    ptk/WatchEvent
    (watch [_ state stream]
      (let [selected-objs (map #(get objects %) selected)
            orig-pos (geom/selection-rect selected-objs)
            mouse-pos @ms/mouse-position
            delta {:x (- (:x mouse-pos) (:x orig-pos))
                   :y (- (:y mouse-pos) (:y orig-pos))}

            rchanges (prepare-changes state delta)
            uchanges (map (fn [ch]


(defn extract-numeric-suffix
  [basename]
  (if-let [[match p1 p2] (re-find #"(.*)-([0-9]+)$" basename)]
    [p1 (+ 1 (d/parse-integer p2))]
    [basename 1]))

(defn impl-generate-unique-name
  "A unique name generator"
