mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 15:41:38 +02:00
📎 Minor cosmetic fixes on workspace shape wrapper component.
This commit is contained in:
parent
76d8ca1e72
commit
5a17237015
1 changed files with 4 additions and 6 deletions
|
@ -90,23 +90,21 @@
|
||||||
on-mouse-enter (use-mouse-enter shape)
|
on-mouse-enter (use-mouse-enter shape)
|
||||||
on-mouse-leave (use-mouse-leave shape)
|
on-mouse-leave (use-mouse-leave shape)
|
||||||
|
|
||||||
|
alt? (hooks/use-rxsub ms/keyboard-alt)
|
||||||
|
|
||||||
moving-iref (mf/use-memo (mf/deps (:id shape))
|
moving-iref (mf/use-memo (mf/deps (:id shape))
|
||||||
#(make-is-moving-ref (:id shape)))
|
#(make-is-moving-ref (:id shape)))
|
||||||
moving? (mf/deref moving-iref)]
|
moving? (mf/deref moving-iref)]
|
||||||
|
|
||||||
(hooks/use-stream ms/keyboard-alt #(reset! alt? %))
|
|
||||||
|
|
||||||
(mf/use-effect
|
(mf/use-effect
|
||||||
(fn []
|
(constantly on-mouse-leave))
|
||||||
(fn []
|
|
||||||
(on-mouse-leave))))
|
|
||||||
|
|
||||||
(when (and shape
|
(when (and shape
|
||||||
(or ghost? (not moving?))
|
(or ghost? (not moving?))
|
||||||
(not (:hidden shape)))
|
(not (:hidden shape)))
|
||||||
[:g.shape-wrapper {:on-mouse-enter on-mouse-enter
|
[:g.shape-wrapper {:on-mouse-enter on-mouse-enter
|
||||||
:on-mouse-leave on-mouse-leave
|
:on-mouse-leave on-mouse-leave
|
||||||
:style {:cursor (if @alt? cur/duplicate nil)}}
|
:style {:cursor (if alt? cur/duplicate nil)}}
|
||||||
(case (:type shape)
|
(case (:type shape)
|
||||||
:path [:> path/path-wrapper opts]
|
:path [:> path/path-wrapper opts]
|
||||||
:text [:> text/text-wrapper opts]
|
:text [:> text/text-wrapper opts]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue