mirror of
https://github.com/penpot/penpot.git
synced 2025-07-26 07:47:12 +02:00
🐛 Fix bug related to path shape initialization
This commit is contained in:
parent
2c61cfd139
commit
810abe6728
2 changed files with 7 additions and 2 deletions
|
@ -450,7 +450,9 @@
|
||||||
|
|
||||||
(defn setup-path
|
(defn setup-path
|
||||||
[{:keys [content selrect points] :as shape}]
|
[{: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))]
|
points (or points (grc/rect->points selrect))]
|
||||||
(-> shape
|
(-> shape
|
||||||
(assoc :selrect selrect)
|
(assoc :selrect selrect)
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
[app.common.types.shape :as cts]
|
[app.common.types.shape :as cts]
|
||||||
[app.common.types.shape-tree :as ctst]
|
[app.common.types.shape-tree :as ctst]
|
||||||
[app.common.types.shape.layout :as ctl]
|
[app.common.types.shape.layout :as ctl]
|
||||||
|
[app.common.uuid :as uuid]
|
||||||
[app.main.data.workspace.drawing.common :as common]
|
[app.main.data.workspace.drawing.common :as common]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.streams :as ms]
|
[app.main.streams :as ms]
|
||||||
|
@ -83,7 +84,6 @@
|
||||||
content (gsp/segments->content segments)
|
content (gsp/segments->content segments)
|
||||||
selrect (gsh/content->selrect content)
|
selrect (gsh/content->selrect content)
|
||||||
points (grc/rect->points selrect)]
|
points (grc/rect->points selrect)]
|
||||||
|
|
||||||
(-> shape
|
(-> shape
|
||||||
(dissoc :segments)
|
(dissoc :segments)
|
||||||
(assoc :content content)
|
(assoc :content content)
|
||||||
|
@ -94,6 +94,7 @@
|
||||||
(<= (count content) 1))
|
(<= (count content) 1))
|
||||||
(assoc :initialized? false)))))))))
|
(assoc :initialized? false)))))))))
|
||||||
|
|
||||||
|
|
||||||
(defn handle-drawing []
|
(defn handle-drawing []
|
||||||
(ptk/reify ::handle-drawing
|
(ptk/reify ::handle-drawing
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
|
@ -102,6 +103,8 @@
|
||||||
mouse (rx/sample 10 ms/mouse-position)
|
mouse (rx/sample 10 ms/mouse-position)
|
||||||
shape (cts/setup-shape {:type :path
|
shape (cts/setup-shape {:type :path
|
||||||
:initialized? true
|
:initialized? true
|
||||||
|
:frame-id uuid/zero
|
||||||
|
:parent-id uuid/zero
|
||||||
:segments []})]
|
:segments []})]
|
||||||
(rx/concat
|
(rx/concat
|
||||||
(rx/of #(update % :workspace-drawing assoc :object shape))
|
(rx/of #(update % :workspace-drawing assoc :object shape))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue