提交 f32265a0 编写于 作者: Q qiang

fix: 解决部分手机上 canvas 监听 touch 事件无法获取触摸坐标的问题

上级 7b8b31dd
......@@ -31,12 +31,12 @@ function resolveColor (color) {
}
function processTouches (target, touches) {
return ([]).map.call(touches, (touche) => {
return ([]).map.call(touches, (touch) => {
var boundingClientRect = target.getBoundingClientRect()
return {
identifier: touche.identifier,
x: touche.clientX - boundingClientRect.x,
y: touche.clientY - boundingClientRect.y
identifier: touch.identifier,
x: touch.clientX - boundingClientRect.left,
y: touch.clientY - boundingClientRect.top
}
})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册