From d82cedcbdd5a235c8b3db546dcb5c554a5894846 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: Mon, 12 Aug 2024 09:55:05 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A1.=E4=BF=AE=E5=A4=8D=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E9=BC=A0=E6=A0=87=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=97=B6=E5=85=B3=E8=81=94=E7=BA=BF=E6=8F=92=E4=BB=B6=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B2.=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=82=B9=E5=87=BB=E7=94=BB=E5=B8=83=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=BF=80=E6=B4=BB=E5=85=B3=E8=81=94=E7=BA=BF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/plugins/AssociativeLine.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/simple-mind-map/src/plugins/AssociativeLine.js b/simple-mind-map/src/plugins/AssociativeLine.js index 51ee8b2f..767785b0 100644 --- a/simple-mind-map/src/plugins/AssociativeLine.js +++ b/simple-mind-map/src/plugins/AssociativeLine.js @@ -68,7 +68,6 @@ class AssociativeLine { this.onNodeDragging = this.onNodeDragging.bind(this) this.onNodeDragend = this.onNodeDragend.bind(this) this.onControlPointMouseup = this.onControlPointMouseup.bind(this) - this.cancelCreateLine = this.cancelCreateLine.bind(this) // 节点树渲染完毕后渲染连接线 this.mindMap.on('node_tree_render_end', this.renderAllLines) @@ -77,7 +76,7 @@ class AssociativeLine { // 监听画布和节点点击事件,用于清除当前激活的连接线 this.mindMap.on('draw_click', this.onDrawClick) this.mindMap.on('node_click', this.onNodeClick) - this.mindMap.on('contextmenu', this.cancelCreateLine) + this.mindMap.on('contextmenu', this.onDrawClick) // 注册删除快捷键 this.mindMap.keyCommand.addShortcut('Del|Backspace', this.removeLine) // 注册添加连接线的命令 @@ -99,7 +98,7 @@ class AssociativeLine { this.mindMap.off('data_change', this.renderAllLines) this.mindMap.off('draw_click', this.onDrawClick) this.mindMap.off('node_click', this.onNodeClick) - this.mindMap.off('contextmenu', this.cancelCreateLine) + this.mindMap.off('contextmenu', this.onDrawClick) this.mindMap.keyCommand.removeShortcut('Del|Backspace', this.removeLine) this.mindMap.command.remove('ADD_ASSOCIATIVE_LINE', this.addLine) this.mindMap.off('mousemove', this.onMousemove) @@ -116,7 +115,7 @@ class AssociativeLine { this.cancelCreateLine() } // 取消激活关联线 - if (this.isControlPointMousedown) { + if (!this.isControlPointMousedown) { this.clearActiveLine() } }