mirror of
https://github.com/pfalstad/circuitjs1.git
synced 2026-03-23 08:46:56 +01:00
highlight other instances of same labeled node
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user