fix(脑图): 节点菜单显示优化

This commit is contained in:
baiqi 2024-08-13 17:11:49 +08:00 committed by 刘瑞斌
parent b329d19e36
commit 21bcfda4de
1 changed files with 6 additions and 2 deletions

View File

@ -252,8 +252,12 @@
nodePosition = window.minder.getSelectedNode()?.getRenderBox(); nodePosition = window.minder.getSelectedNode()?.getRenderBox();
} }
const state = window.editor.fsm.state(); const state = window.editor.fsm.state();
if (nodePosition && isNodeInMinderView(undefined, nodePosition, nodePosition.width / 2) && state !== 'input') { if (
// nodePosition &&
isNodeInMinderView(undefined, nodePosition, Math.min(nodePosition.width / 2, 200)) &&
state !== 'input'
) {
// ( 200px 200px )
const nodeDomHeight = nodePosition.height || 0; const nodeDomHeight = nodePosition.height || 0;
menuPopupOffset.value = [nodePosition.x, nodePosition.y + nodeDomHeight + 4]; // 4px menuPopupOffset.value = [nodePosition.x, nodePosition.y + nodeDomHeight + 4]; // 4px
menuVisible.value = true; menuVisible.value = true;