mirror of
https://github.com/penpot/penpot.git
synced 2025-07-27 06:07:18 +02:00
🐛 Many bugfixes.
This commit is contained in:
parent
86a55fd292
commit
ff43df6822
10 changed files with 97 additions and 112 deletions
|
@ -22,10 +22,13 @@
|
|||
(declare rect-shape)
|
||||
|
||||
(mf/defc rect-wrapper
|
||||
{:wrap [#(mf/wrap-memo % =)]}
|
||||
[{:keys [shape] :as props}]
|
||||
(let [selected (mf/deref refs/selected-shapes)
|
||||
selected? (contains? selected (:id shape))
|
||||
on-mouse-down #(common/on-mouse-down % shape selected)]
|
||||
(let [selected-iref (mf/use-memo
|
||||
{:fn #(refs/make-selected (:id shape))
|
||||
:deps (mf/deps (:id shape))})
|
||||
selected? (mf/deref selected-iref)
|
||||
on-mouse-down #(common/on-mouse-down % shape)]
|
||||
[:g.shape {:class (when selected? "selected")
|
||||
:on-mouse-down on-mouse-down}
|
||||
[:& rect-shape {:shape shape}]]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue