fix: 自定义节点问题

This commit is contained in:
黎智洲
2022-05-15 00:21:52 +08:00
parent 4ef63ec96d
commit 3ad6bbc3e3
2 changed files with 7 additions and 3 deletions
+2 -1
View File
@@ -2,4 +2,5 @@ node_modules
test
dist
资料
\copyDist2Anyview.js
\copyDist2Anyview.js
g6Test
+5 -2
View File
@@ -145,8 +145,11 @@ export const Util = {
},
registerShape(shapeName: string, shapeDefinition, extendShapeType?: string) {
// 不定义updateg6的自定义节点里面的update好像有bug
shapeDefinition.update = undefined;
if(!shapeDefinition.update) {
// 因为大多数节点继承了rect,rect的update有时候会和选定高亮功能有冲突,所以打个补丁
shapeDefinition.update = undefined;
}
return registerNode(shapeName, shapeDefinition, extendShapeType);
}
};