highlight other instances of same labeled node

This commit is contained in:
pf
2021-07-23 17:01:42 -07:00
parent 36fe4c81f6
commit 5538feee5c
2 changed files with 11 additions and 1 deletions

View File

@@ -4178,6 +4178,16 @@ MouseOutHandler, MouseWheelHandler {
}
}
boolean matchesMouseElm(CircuitElm ce) {
if (mouseElm == null)
return false;
if (ce instanceof LabeledNodeElm && mouseElm instanceof LabeledNodeElm &&
ce.getNode(0) == mouseElm.getNode(0)) {
return true;
}
return false;
}
void removeZeroLengthElements() {
int i;
boolean changed = false;

View File

@@ -988,7 +988,7 @@ public abstract class CircuitElm implements Editable {
return ((x1 == y1 && x2 == y2) || (x1 == y2 && x2 == y1));
}
boolean needsHighlight() {
return mouseElmRef==this || selected || sim.plotYElm == this ||
return mouseElmRef==this || selected || sim.plotYElm == this || sim.matchesMouseElm(this) ||
// Test if the current mouseElm is a ScopeElm and, if so, does it belong to this elm
(mouseElmRef instanceof ScopeElm && ((ScopeElm) mouseElmRef).elmScope.getElm()==this);
}