将外部指针覆盖结点上

This commit is contained in:
zhenggengtong 2022-10-23 23:29:24 +08:00
parent cff4e4a070
commit 8cbc2cdc3b

View File

@ -1,5 +1,6 @@
import { Engine } from '../engine'; import { Engine } from '../engine';
import { SVModel } from '../Model/SVModel'; import { SVModel } from '../Model/SVModel';
import { SVMarker } from '../Model/SVNodeAppendage'
import { Util } from '../Common/util'; import { Util } from '../Common/util';
import { Tooltip, Graph, GraphData, Modes } from '@antv/g6'; import { Tooltip, Graph, GraphData, Modes } from '@antv/g6';
import { InitG6Behaviors } from '../BehaviorHelper/initG6Behaviors'; import { InitG6Behaviors } from '../BehaviorHelper/initG6Behaviors';
@ -150,7 +151,14 @@ export class Renderer {
item.G6Item['SVModel'] = item; item.G6Item['SVModel'] = item;
}); });
//外部指针在结点图层上方
this.g6Instance.getNodes().forEach(item => {
if (item['SVModel'] instanceof SVMarker) {
item.toFront()
}
})
this.g6Instance.getEdges().forEach(item => item.toFront()); this.g6Instance.getEdges().forEach(item => item.toFront());
this.g6Instance.paint(); this.g6Instance.paint();
} }