Fix unexpected exception on path edition.

This commit is contained in:
Andrey Antukh 2017-02-21 18:19:24 +01:00
parent bedd1def21
commit 8de6311c1f
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -504,7 +504,7 @@
(deftype UpdatePath [id index delta] (deftype UpdatePath [id index delta]
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
(update-in state [:shapes id :points index] gpt/add delta))) (update-in state [:shapes id :segments index] gpt/add delta)))
(defn update-path (defn update-path
"Update a concrete point in the path shape." "Update a concrete point in the path shape."
@ -516,7 +516,7 @@
ptk/WatchEvent ptk/WatchEvent
(watch [_ state s] (watch [_ state s]
(let [shape (get-in state [:shapes id]) (let [shape (get-in state [:shapes id])
point (get-in shape [:points index]) point (get-in shape [:segments index])
point (gpt/add point canvas-coords)] point (gpt/add point canvas-coords)]
(->> (uwrk/align-point point) (->> (uwrk/align-point point)
(rx/map #(gpt/subtract % point)) (rx/map #(gpt/subtract % point))