mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 16:51:38 +02:00
🐛 Fix context menu handling on image shapes.
This commit is contained in:
parent
e056da04c3
commit
11f54f51ea
1 changed files with 10 additions and 2 deletions
|
@ -25,9 +25,17 @@
|
||||||
[{:keys [shape frame] :as props}]
|
[{:keys [shape frame] :as props}]
|
||||||
(let [selected (mf/deref refs/selected-shapes)
|
(let [selected (mf/deref refs/selected-shapes)
|
||||||
selected? (contains? selected (:id shape))
|
selected? (contains? selected (:id shape))
|
||||||
on-mouse-down #(common/on-mouse-down % shape)]
|
on-mouse-down (mf/use-callback
|
||||||
|
(mf/deps shape)
|
||||||
|
#(common/on-mouse-down % shape))
|
||||||
|
|
||||||
|
on-context-menu (mf/use-callback
|
||||||
|
(mf/deps shape)
|
||||||
|
#(common/on-context-menu % shape))]
|
||||||
|
|
||||||
[:g.shape {:class (when selected? "selected")
|
[:g.shape {:class (when selected? "selected")
|
||||||
:on-mouse-down on-mouse-down}
|
:on-mouse-down on-mouse-down
|
||||||
|
:on-context-menu on-context-menu}
|
||||||
[:& image-shape {:shape (geom/transform-shape frame shape)}]]))
|
[:& image-shape {:shape (geom/transform-shape frame shape)}]]))
|
||||||
|
|
||||||
;; --- Image Shape
|
;; --- Image Shape
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue