hookehuyr

test 点击显示四边锚点的操作

...@@ -64,6 +64,11 @@ export function clickSelect(G6) { ...@@ -64,6 +64,11 @@ export function clickSelect(G6) {
64 } 64 }
65 graph.setAutoPaint(autoPaint); 65 graph.setAutoPaint(autoPaint);
66 graph.paint(); 66 graph.paint();
67 + // TEST: 点击时隐藏所有锚点,显示当前锚点
68 + // graph.getNodes().forEach(node => {
69 + // node.hideAnchor(graph)
70 + // });
71 + // item.showAnchor(graph)
67 }, 72 },
68 onCanvasClick() { 73 onCanvasClick() {
69 74
......
...@@ -31,9 +31,11 @@ export function hoverAnchorActive(G6) { ...@@ -31,9 +31,11 @@ export function hoverAnchorActive(G6) {
31 onLeaveNode(e) { 31 onLeaveNode(e) {
32 try { 32 try {
33 const item = e.item; 33 const item = e.item;
34 - item.hideAnchor(this.graph) 34 + // TEST: 注释掉鼠标离开时隐藏当前锚点,可以配合单击显示锚点使用。
35 + item.hideAnchor(this.graph);
35 } catch (e) { 36 } catch (e) {
37 + console.error(e);
36 } 38 }
37 }, 39 },
38 }) 40 })
39 -}
...\ No newline at end of file ...\ No newline at end of file
41 +}
......