Fix:修复富文本模式下,处于节点文本编辑中时通过鼠标滚轮缩放画布时,节点文本会消失的问题
This commit is contained in:
parent
2d0310f675
commit
07712e7ac3
@ -161,7 +161,6 @@ export default class TextEdit {
|
|||||||
|
|
||||||
// 注册临时快捷键
|
// 注册临时快捷键
|
||||||
registerTmpShortcut() {
|
registerTmpShortcut() {
|
||||||
// 注册回车快捷键
|
|
||||||
this.mindMap.keyCommand.addShortcut('Enter', () => {
|
this.mindMap.keyCommand.addShortcut('Enter', () => {
|
||||||
this.hideEditTextBox()
|
this.hideEditTextBox()
|
||||||
})
|
})
|
||||||
@ -178,7 +177,7 @@ export default class TextEdit {
|
|||||||
return this.showTextEdit
|
return this.showTextEdit
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示文本编辑框
|
// 显示文本编辑框
|
||||||
// isInserting:是否是刚创建的节点
|
// isInserting:是否是刚创建的节点
|
||||||
// isFromKeyDown:是否是在按键事件进入的编辑
|
// isFromKeyDown:是否是在按键事件进入的编辑
|
||||||
async show({
|
async show({
|
||||||
@ -207,6 +206,10 @@ export default class TextEdit {
|
|||||||
const { offsetLeft, offsetTop } = checkNodeOuter(this.mindMap, node)
|
const { offsetLeft, offsetTop } = checkNodeOuter(this.mindMap, node)
|
||||||
this.mindMap.view.translateXY(offsetLeft, offsetTop)
|
this.mindMap.view.translateXY(offsetLeft, offsetTop)
|
||||||
const g = node._textData.node
|
const g = node._textData.node
|
||||||
|
// 需要先显示,不然宽高获取到的可能是0
|
||||||
|
if (openRealtimeRenderOnNodeTextEdit) {
|
||||||
|
g.show()
|
||||||
|
}
|
||||||
const rect = g.node.getBoundingClientRect()
|
const rect = g.node.getBoundingClientRect()
|
||||||
// 如果开启了大小实时更新,那么直接隐藏节点原文本
|
// 如果开启了大小实时更新,那么直接隐藏节点原文本
|
||||||
if (openRealtimeRenderOnNodeTextEdit) {
|
if (openRealtimeRenderOnNodeTextEdit) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user