0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-23 23:35:58 -05:00

🐛 Fixed problem when editing paths

This commit is contained in:
alonso.torres 2021-02-03 12:46:59 +01:00 committed by Andrey Antukh
parent 19ed0b70c2
commit cbdfb4349b
2 changed files with 4 additions and 3 deletions

View file

@ -692,8 +692,8 @@
point (-> content (get (if (= prefix :c1) (dec index) index)) (ugp/command->point))
handler (-> content (get index) (ugp/get-handler prefix))
current-distance (gpt/distance (ugp/opposite-handler point handler) opposite-handler)
match-opposite? (mth/almost-zero? current-distance)]
current-distance (when opposite-handler (gpt/distance (ugp/opposite-handler point handler) opposite-handler))
match-opposite? (and opposite-handler (mth/almost-zero? current-distance))]
(drag-stream
(rx/concat

View file

@ -289,7 +289,8 @@
(:c2x params) (update-in [index :params :c2x] + (:c2x params))
(:c2y params) (update-in [index :params :c2y] + (:c2y params)))
content))]
(reduce apply-to-index content modifiers)))
(let [content (if (vector? content) content (into [] content))]
(reduce apply-to-index content modifiers))))
(defn command->point [command]
(when-not (nil? command)