fixes an issue with tooltips in generic circuits, closes #599

This commit is contained in:
hneemann 2021-01-03 20:34:43 +01:00
parent 292b2ec718
commit 132d5c46e1

View File

@ -570,8 +570,12 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib
removeHighLighted(); removeHighLighted();
} }
Circuit circuit = shallowCopy;
if (circuit == null)
circuit = getCircuit();
Vector pos = getPosVector(event); Vector pos = getPosVector(event);
VisualElement ve = getCircuit().getElementAt(pos); VisualElement ve = circuit.getElementAt(pos);
if (ve != null) { if (ve != null) {
Pin p = ve.getPinAt(raster(pos)); Pin p = ve.getPinAt(raster(pos));
if (p != null) if (p != null)
@ -592,7 +596,7 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib
} }
} }
Wire w = getCircuit().getWireAt(pos, (int) (SIZE2 / transform.getScaleX())); Wire w = circuit.getWireAt(pos, (int) (SIZE2 / transform.getScaleX()));
if (w != null) { if (w != null) {
ObservableValue v = w.getValue(); ObservableValue v = w.getValue();
if (v != null) if (v != null)