[fix] right click (#1891)
This PR fixes right clicks. ### Change Type - [x] `patch` — Bug fix ### Test Plan 1. Right click a shape. The context menu should show information relevant to the shape. 2. Lock a shape. 3. Right click to get to the unlock from the context menu.
This commit is contained in:
parent
beb9db8eb7
commit
10f6818a79
1 changed files with 11 additions and 0 deletions
|
@ -13,6 +13,17 @@ export function useCanvasEvents() {
|
||||||
|
|
||||||
function onPointerDown(e: React.PointerEvent) {
|
function onPointerDown(e: React.PointerEvent) {
|
||||||
if ((e as any).isKilled) return
|
if ((e as any).isKilled) return
|
||||||
|
|
||||||
|
if (e.button === 2) {
|
||||||
|
editor.dispatch({
|
||||||
|
type: 'pointer',
|
||||||
|
target: 'canvas',
|
||||||
|
name: 'right_click',
|
||||||
|
...getPointerInfo(e),
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (e.button !== 0 && e.button !== 1 && e.button !== 5) return
|
if (e.button !== 0 && e.button !== 1 && e.button !== 5) return
|
||||||
|
|
||||||
setPointerCapture(e.currentTarget, e)
|
setPointerCapture(e.currentTarget, e)
|
||||||
|
|
Loading…
Reference in a new issue