提交 d65ff05a 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

chore(uts): 自动化测试 touch 事件支持 screen、client 坐标

上级 8bea6161
......@@ -464,7 +464,11 @@ export const handleTouchEvent = (
type TypeTouch = {
identifier: number
pageX: number
pageY: number
pageY: number,
screenX?: number | null,
screenY?: number | null,
clientX?: number | null,
clientY?: number | null,
}
function getTouches(touches: any[]): Touch[] {
......@@ -476,6 +480,18 @@ function getTouches(touches: any[]): Touch[] {
result.identifier = touchObj.identifier.toFloat()
result.pageX = touchObj.pageX.toFloat()
result.pageY = touchObj.pageY.toFloat()
if (touchObj.screenX !== null) {
result.screenX = touchObj.screenX!.toFloat()
}
if (touchObj.screenY !== null) {
result.screenY = touchObj.screenY!.toFloat()
}
if (touchObj.clientX !== null) {
result.clientX = touchObj.clientX!.toFloat()
}
if (touchObj.clientY !== null) {
result.clientY = touchObj.clientY!.toFloat()
}
return result
})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册