From 63b04e5acc3a680cc85237c4ad882fff76159a98 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Sun, 17 Dec 2023 20:56:41 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=E4=BF=AE=E5=A4=8D=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E6=88=96=E8=A7=A6=E6=8E=A7=E6=9D=BF=E6=B0=B4=E5=B9=B3=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=E7=94=BB=E5=B8=83=E7=A7=BB=E5=8A=A8=E6=96=B9?= =?UTF-8?q?=E5=90=91=E7=9B=B8=E5=8F=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/core/view/View.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/simple-mind-map/src/core/view/View.js b/simple-mind-map/src/core/view/View.js index ddbb4531..f9a9eb87 100644 --- a/simple-mind-map/src/core/view/View.js +++ b/simple-mind-map/src/core/view/View.js @@ -37,7 +37,7 @@ class View { this.mindMap.event.on('drag', (e, event) => { // 按住ctrl键拖动为多选 // 禁用拖拽 - if (e.ctrlKey || this.mindMap.opt.isDisableDrag) { + if (e.ctrlKey || this.mindMap.opt.isDisableDrag) { return } if (this.firstDrag) { @@ -56,7 +56,7 @@ class View { }) // 放大缩小视图 this.mindMap.event.on('mousewheel', (e, dir, event, isTouchPad) => { - let { + const { customHandleMousewheel, mousewheelAction, mouseScaleCenterUseMousePosition, @@ -78,8 +78,8 @@ class View { e.clientX, e.clientY ) - let cx = mouseScaleCenterUseMousePosition ? clientX : undefined - let cy = mouseScaleCenterUseMousePosition ? clientY : undefined + const cx = mouseScaleCenterUseMousePosition ? clientX : undefined + const cy = mouseScaleCenterUseMousePosition ? clientY : undefined switch (dir) { // 鼠标滚轮,向上和向左,都是缩小 case CONSTANTS.DIR.UP: @@ -113,11 +113,11 @@ class View { break // 右移 case CONSTANTS.DIR.LEFT: - this.translateX(-step) + this.translateX(step) break // 左移 case CONSTANTS.DIR.RIGHT: - this.translateX(step) + this.translateX(-step) break } } @@ -261,8 +261,7 @@ class View { let drawWidth = rect.width / origTransform.scaleX let drawHeight = rect.height / origTransform.scaleY let drawRatio = drawWidth / drawHeight - let { width: elWidth, height: elHeight } = - this.mindMap.elRect + let { width: elWidth, height: elHeight } = this.mindMap.elRect elWidth = elWidth - fitPadding * 2 elHeight = elHeight - fitPadding * 2 let elRatio = elWidth / elHeight