avoid pointerUptime update before calculating isDoubleClick (#1055)

This commit is contained in:
Ricardo Crespo 2022-12-03 13:03:22 +01:00 committed by GitHub
parent 73e87d8732
commit 412d4db618
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,6 +54,8 @@ export function useCanvasEvents() {
inputs.activePointer = undefined inputs.activePointer = undefined
if (!inputs.pointerIsValid(e)) return if (!inputs.pointerIsValid(e)) return
const isDoubleClick = inputs.isDoubleClick()
const info = inputs.pointerUp(e, 'canvas') const info = inputs.pointerUp(e, 'canvas')
// On right click up // On right click up
@ -62,8 +64,6 @@ export function useCanvasEvents() {
return return
} }
const isDoubleClick = inputs.isDoubleClick()
// Release pointer capture, if any // Release pointer capture, if any
if (e.currentTarget.hasPointerCapture(e.pointerId)) { if (e.currentTarget.hasPointerCapture(e.pointerId)) {
e.currentTarget?.releasePointerCapture(e.pointerId) e.currentTarget?.releasePointerCapture(e.pointerId)