fix: update clear order

This commit is contained in:
ColinChen2 2023-09-25 15:56:41 +08:00
parent da2ebff025
commit 7cd20cb76b

View File

@ -334,9 +334,7 @@ export class EdgeFilterLens extends Base {
*/ */
public clear() { public clear() {
const { graph, delegate: lensDelegate, cachedTransientNodes, cachedTransientEdges } = this; const { graph, delegate: lensDelegate, cachedTransientNodes, cachedTransientEdges } = this;
cachedTransientNodes.clear();
cachedTransientEdges.clear();
if (lensDelegate && !lensDelegate.destroyed) { if (lensDelegate && !lensDelegate.destroyed) {
graph.drawTransient('circle', 'lens-shape', { action: 'remove' }); graph.drawTransient('circle', 'lens-shape', { action: 'remove' });
} }
@ -346,6 +344,9 @@ export class EdgeFilterLens extends Base {
cachedTransientEdges.forEach((id) => { cachedTransientEdges.forEach((id) => {
graph.drawTransient('edge', id, { action: 'remove' }); graph.drawTransient('edge', id, { action: 'remove' });
}); });
cachedTransientNodes.clear();
cachedTransientEdges.clear();
} }
/** /**