From 888b8e725ad3a77832bfaf8abfc5d6d1c22bec8e Mon Sep 17 00:00:00 2001 From: Xbs233 <32960078+Xbs233@users.noreply.github.com> Date: Tue, 8 Aug 2023 21:23:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=89=8B=E5=8A=BF=E7=BC=A9=E5=B0=8F?= =?UTF-8?q?=E6=97=B6=20=E4=BC=9A=E5=85=88=E6=94=BE=E5=A4=A7=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=20=E5=86=8D=E7=BC=A9=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复初次onTouchmove时 必然是放大的情况 --- simple-mind-map/src/plugins/TouchEvent.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simple-mind-map/src/plugins/TouchEvent.js b/simple-mind-map/src/plugins/TouchEvent.js index ea8681b4..e8328ae5 100644 --- a/simple-mind-map/src/plugins/TouchEvent.js +++ b/simple-mind-map/src/plugins/TouchEvent.js @@ -57,7 +57,10 @@ class TouchEvent { let { x: touch2ClientX, y: touch2ClientY } = this.mindMap.toPos(touch2.clientX, touch2.clientY) let cx = (touch1ClientX + touch2ClientX) / 2 let cy = (touch1ClientY + touch2ClientY) / 2 - if (distance > this.doubleTouchmoveDistance) { + if (this.doubleTouchmoveDistance === 0) { + this.doubleTouchmoveDistance = distance + return; + } else if (distance > this.doubleTouchmoveDistance) { // 放大 this.mindMap.view.enlarge(cx, cy, true) } else {