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
|
||||
if (!inputs.pointerIsValid(e)) return
|
||||
|
||||
e.currentTarget.setPointerCapture(e.pointerId)
|
||||
|
||||
// On right click
|
||||
if (e.button === 2) {
|
||||
callbacks.onRightPointCanvas?.(inputs.pointerDown(e, 'canvas'), e)
|
||||
return
|
||||
}
|
||||
|
||||
e.currentTarget.setPointerCapture(e.pointerId)
|
||||
|
||||
const info = inputs.pointerDown(e, 'canvas')
|
||||
|
||||
// On left click down
|
||||
|
@ -54,13 +54,14 @@ export function useCanvasEvents() {
|
|||
inputs.activePointer = undefined
|
||||
if (!inputs.pointerIsValid(e)) return
|
||||
|
||||
const info = inputs.pointerUp(e, 'canvas')
|
||||
|
||||
// On right click up
|
||||
if (e.button === 2) {
|
||||
callbacks.onPointerUp?.(info, e)
|
||||
return
|
||||
}
|
||||
|
||||
const info = inputs.pointerUp(e, 'canvas')
|
||||
|
||||
const isDoubleClick = inputs.isDoubleClick()
|
||||
|
||||
// Release pointer capture, if any
|
||||
|
|
Loading…
Reference in a new issue