@pmndrs/pointer-events
Advanced tools
Comparing version
@@ -26,6 +26,10 @@ import { Object3D, OrthographicCamera, PerspectiveCamera } from 'three'; | ||
/** | ||
* @default 300 | ||
* @deprecated use clickThresholdMs instead | ||
*/ | ||
clickThesholdMs?: number; | ||
/** | ||
* @default 300 | ||
*/ | ||
clickThresholdMs?: number; | ||
/** | ||
* @default 500 | ||
@@ -32,0 +36,0 @@ */ |
@@ -211,5 +211,5 @@ import { Object3D } from 'three'; | ||
} | ||
const { contextMenuButton = 2, dblClickThresholdMs = 500, clickThesholdMs = 300 } = this.options; | ||
const { clickThesholdMs, contextMenuButton = 2, dblClickThresholdMs = 500, clickThresholdMs = clickThesholdMs ?? 300, } = this.options; | ||
this.pointerCapture = undefined; | ||
const isClicked = getIsClicked(this.buttonsDownTime, this.intersection.object[buttonsDownTimeKey], nativeEvent.button, nativeEvent.timeStamp, clickThesholdMs); | ||
const isClicked = getIsClicked(this.buttonsDownTime, this.intersection.object[buttonsDownTimeKey], nativeEvent.button, nativeEvent.timeStamp, clickThresholdMs); | ||
const camera = this.getCamera(); | ||
@@ -316,3 +316,3 @@ //context menu | ||
} | ||
function getIsClicked(pointerButtonsPressTime, objectButtonsDownTime, button, buttonUpTime, clickThesholdMs) { | ||
function getIsClicked(pointerButtonsPressTime, objectButtonsDownTime, button, buttonUpTime, clickThresholdMs) { | ||
if (objectButtonsDownTime == null) { | ||
@@ -325,3 +325,3 @@ return false; | ||
} | ||
if (buttonUpTime - objectButtonPressTime > clickThesholdMs) { | ||
if (buttonUpTime - objectButtonPressTime > clickThresholdMs) { | ||
return false; | ||
@@ -328,0 +328,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"license": "SEE LICENSE IN LICENSE", | ||
"version": "6.6.7", | ||
"version": "6.6.8", | ||
"homepage": "https://github.com/pmndrs/xr", | ||
@@ -8,0 +8,0 @@ "author": "Bela Bohlender", |
106637
0.13%2556
0.16%