Changed how link highlight text is updated
Also added in widening of text box and different kerning options
Change-Id: I141251a2b3258de2cd8f7b0d47510ea9b7340fd4
(cherry picked from commit 00e56d0efb4600eddf0d623703c45b2838c9bcfa)
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.ts b/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.ts
index 486bb86..e824e20 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/forcesvg.component.ts
@@ -100,6 +100,7 @@
public graph: ForceDirectedGraph;
private selectedNodes: UiElement[] = [];
viewInitialized: boolean = false;
+ linksHighlighted: Map<string, LinkHighlight>;
// References to the children of this component - these are created in the
// template view with the *ngFor and we get them by a query here
@@ -114,6 +115,7 @@
) {
this.selectedLink = null;
this.log.debug('ForceSvgComponent constructed');
+ this.linksHighlighted = new Map<string, LinkHighlight>();
}
/**
@@ -595,14 +597,9 @@
if (fadeMs > 0) {
lh.fadems = fadeMs;
}
- // Don't user .filter() above as it will create a copy of the component which will be discarded
- this.links.forEach((l) => {
- if (l.link.id === Link.linkIdFromShowHighlights(lh.id)) {
- l.linkHighlight = lh;
- this.ref.markForCheck(); // Forces ngOnChange in the LinkSvgComponent
- }
- });
+ this.linksHighlighted.set(Link.linkIdFromShowHighlights(lh.id), lh);
});
+ this.ref.detectChanges(); // Forces ngOnChange in the LinkSvgComponent
}
}