diff --git a/common/src/app/common/types/shape.cljc b/common/src/app/common/types/shape.cljc index 0a1d5d9594..ea3c1050d5 100644 --- a/common/src/app/common/types/shape.cljc +++ b/common/src/app/common/types/shape.cljc @@ -450,7 +450,9 @@ (defn setup-path [{:keys [content selrect points] :as shape}] - (let [selrect (or selrect (gsh/content->selrect content)) + (let [selrect (or selrect + (gsh/content->selrect content) + (grc/make-rect)) points (or points (grc/rect->points selrect))] (-> shape (assoc :selrect selrect) diff --git a/frontend/src/app/main/data/workspace/drawing/curve.cljs b/frontend/src/app/main/data/workspace/drawing/curve.cljs index 1f94663500..0f2ddb675f 100644 --- a/frontend/src/app/main/data/workspace/drawing/curve.cljs +++ b/frontend/src/app/main/data/workspace/drawing/curve.cljs @@ -16,6 +16,7 @@ [app.common.types.shape :as cts] [app.common.types.shape-tree :as ctst] [app.common.types.shape.layout :as ctl] + [app.common.uuid :as uuid] [app.main.data.workspace.drawing.common :as common] [app.main.data.workspace.state-helpers :as wsh] [app.main.streams :as ms] @@ -83,7 +84,6 @@ content (gsp/segments->content segments) selrect (gsh/content->selrect content) points (grc/rect->points selrect)] - (-> shape (dissoc :segments) (assoc :content content) @@ -94,6 +94,7 @@ (<= (count content) 1)) (assoc :initialized? false))))))))) + (defn handle-drawing [] (ptk/reify ::handle-drawing ptk/WatchEvent @@ -102,6 +103,8 @@ mouse (rx/sample 10 ms/mouse-position) shape (cts/setup-shape {:type :path :initialized? true + :frame-id uuid/zero + :parent-id uuid/zero :segments []})] (rx/concat (rx/of #(update % :workspace-drawing assoc :object shape))