From 1dcb5f92ce1b9d282842b9b021f118f874c25b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B4=A2=E4=B8=98?= Date: Fri, 28 Feb 2020 11:40:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dx,=20y=E4=B8=BA0?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphic/event/controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graphic/event/controller.js b/src/graphic/event/controller.js index d0f24787b..86d7beb99 100644 --- a/src/graphic/event/controller.js +++ b/src/graphic/event/controller.js @@ -1,4 +1,5 @@ import { getRelativePosition } from '../../util/dom'; +import { isNumber } from '../../util/common'; // 计算滑动的方向 const calcDirection = (start, end) => { @@ -35,7 +36,7 @@ const convertPoints = (ev, canvas) => { const { x, y, clientX, clientY } = touch; let point; // 小程序环境会有x,y - if (x && y) { + if (isNumber(x) || isNumber(y)) { point = { x, y }; } else { // 浏览器环境再计算下canvas的相对位置