mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 18:37:43 +08:00
fix:手势缩小时 会先放大一次 再缩小
修复初次onTouchmove时 必然是放大的情况
This commit is contained in:
parent
d707329526
commit
888b8e725a
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user