Call onPointerUp on right pointer up (#1008)
* Call onPointerUp on right pointer up * Set pointer capture on right point events on the canvas
This commit is contained in:
parent
6bbff94464
commit
7e2395884e
1 changed files with 5 additions and 4 deletions
|
@ -11,14 +11,14 @@ export function useCanvasEvents() {
|
||||||
else (e as any).dead = true
|
else (e as any).dead = true
|
||||||
if (!inputs.pointerIsValid(e)) return
|
if (!inputs.pointerIsValid(e)) return
|
||||||
|
|
||||||
|
e.currentTarget.setPointerCapture(e.pointerId)
|
||||||
|
|
||||||
// On right click
|
// On right click
|
||||||
if (e.button === 2) {
|
if (e.button === 2) {
|
||||||
callbacks.onRightPointCanvas?.(inputs.pointerDown(e, 'canvas'), e)
|
callbacks.onRightPointCanvas?.(inputs.pointerDown(e, 'canvas'), e)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
e.currentTarget.setPointerCapture(e.pointerId)
|
|
||||||
|
|
||||||
const info = inputs.pointerDown(e, 'canvas')
|
const info = inputs.pointerDown(e, 'canvas')
|
||||||
|
|
||||||
// On left click down
|
// On left click down
|
||||||
|
@ -54,13 +54,14 @@ export function useCanvasEvents() {
|
||||||
inputs.activePointer = undefined
|
inputs.activePointer = undefined
|
||||||
if (!inputs.pointerIsValid(e)) return
|
if (!inputs.pointerIsValid(e)) return
|
||||||
|
|
||||||
|
const info = inputs.pointerUp(e, 'canvas')
|
||||||
|
|
||||||
// On right click up
|
// On right click up
|
||||||
if (e.button === 2) {
|
if (e.button === 2) {
|
||||||
|
callbacks.onPointerUp?.(info, e)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const info = inputs.pointerUp(e, 'canvas')
|
|
||||||
|
|
||||||
const isDoubleClick = inputs.isDoubleClick()
|
const isDoubleClick = inputs.isDoubleClick()
|
||||||
|
|
||||||
// Release pointer capture, if any
|
// Release pointer capture, if any
|
||||||
|
|
Loading…
Reference in a new issue