mirror of
https://github.com/penpot/penpot.git
synced 2026-03-05 01:31:05 +00:00
🐛 Fix context menu handling on image shapes.
This commit is contained in:
committed by
Alonso Torres
parent
e056da04c3
commit
11f54f51ea
@@ -25,9 +25,17 @@
|
||||
[{:keys [shape frame] :as props}]
|
||||
(let [selected (mf/deref refs/selected-shapes)
|
||||
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")
|
||||
: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
|
||||
|
||||
Reference in New Issue
Block a user