From e24fd9bdbb05ffa7e7ce78e0b2b2cf8845c1650d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Thu, 17 Oct 2024 09:34:17 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=BC=80?= =?UTF-8?q?=E5=90=AFmaxImgResizeWidthInheritTheme=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E5=90=8E=E7=AC=AC=E4=B8=80=E6=AC=A1=E4=B8=8A=E4=BC=A0=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=8B=96=E5=8A=A8=E5=9B=BE=E7=89=87=E5=88=B0=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E5=80=BC=E4=BC=9A=E5=AF=BC=E8=87=B4=E5=90=8E=E7=BB=AD?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8C=89=E9=92=AE=E6=97=A0=E6=B3=95=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=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/plugins/NodeImgAdjust.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/simple-mind-map/src/plugins/NodeImgAdjust.js b/simple-mind-map/src/plugins/NodeImgAdjust.js index 1e549ff3..ce2a17d4 100644 --- a/simple-mind-map/src/plugins/NodeImgAdjust.js +++ b/simple-mind-map/src/plugins/NodeImgAdjust.js @@ -289,11 +289,14 @@ class NodeImgAdjust { // 隐藏自定义元素 this.hideHandleEl() // 更新节点图片为新的大小 - const { image, imageTitle, imageSize } = this.node.getData() + const { image, imageTitle } = this.node.getData() const { scaleX, scaleY } = this.mousedownDrawTransform const newWidth = this.currentImgWidth / scaleX const newHeight = this.currentImgHeight / scaleY - if (newWidth !== imageSize.width || newHeight !== imageSize.height) { + if ( + Math.abs(newWidth - this.rect.width) > 1 || + Math.abs(newHeight - this.rect.height) > 1 + ) { this.mindMap.execCommand('SET_NODE_IMAGE', this.node, { url: image, title: imageTitle,