                    :walls (:walls new-world)
                    :seen-polys {}
                    :explored #{}
-                   :seen-configs #{})
+                   :seen-configs #{}
+                   :width (:width desc)
+                   :height (:height desc)
+                   :scroll-x (if (>= (:scroll-x w) (:width desc))
+                               (:width desc)
+                               (:scroll-x w))
+                   :scroll-y (if (>= (:scroll-y w) (:height desc))
+                               (:height desc)
+                               (:scroll-y desc)))
         w (update w
                   :configs
                   (fn [cfgs]

        f (.createFactory js/React c)]
    f))

(defn num-changer [world label key]
  (sab/html
    [:label {} label]
    [:input {:type     "number"
             :key      key
             :value    (key @world)
             :onChange (fn [evt]
                         (update-world! world
                                        (fn [w]
                                          (println "set" key "from" (key w) "to" (.-value (.-target evt)))
                                          (assoc w key (.-value (.-target evt))))))}]))

(defn edit-controls [world]
  (sab/html (num-changer world "World Width" :width)
            (num-changer world "World Height" :height)
            (num-changer world "Scroll X" :scroll-x)
            (num-changer world "Scroll Y" :scroll-y)
            (num-changer world "Camera Width" :camera-width)
            (num-changer world "Camera Height" :camera-height)))

(defn rererender [target]
  (let [w @world

    (world-append (update w :configs #(subvec % 0 (dec (count %))))
                  (heval/recache-trs new-defs (current-config w)))))

(defn world-update-desc! [world desc]
  (update-world! world
                 (fn [w]
                   (world-update-desc w desc))))
