From 3ddecef5a74f4e6efdb9a567ac08903cb9a4177d Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 26 Aug 2024 15:41:44 +0200 Subject: [PATCH] :sparkles: Ensure plain map on path params in several functions --- frontend/src/app/util/path/tools.cljs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/util/path/tools.cljs b/frontend/src/app/util/path/tools.cljs index 516ef047d..fcd65f4e1 100644 --- a/frontend/src/app/util/path/tools.cljs +++ b/frontend/src/app/util/path/tools.cljs @@ -28,7 +28,7 @@ (= cur-point handler-c2) (= pre-point handler-c1)) (assoc content index {:command :line-to - :params cur-point}) + :params (into {} cur-point)}) content)))] (reduce process-command content with-prev))) @@ -69,10 +69,13 @@ h2 (gpt/add to-p dv2)] (-> cmd (assoc :command :curve-to) - (assoc-in [:params :c1x] (:x h1)) - (assoc-in [:params :c1y] (:y h1)) - (assoc-in [:params :c2x] (:x h2)) - (assoc-in [:params :c2y] (:y h2))))) + (update :params (fn [params] + ;; ensure plain map + (-> (into {} params) + (assoc :c1x (:x h1)) + (assoc :c1y (:y h1)) + (assoc :c2x (:x h2)) + (assoc :c2y (:y h2)))))))) (defn is-curve? [content point]