mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-17 08:55:05 -04:00
recalculate wires if wires are deleted
This commit is contained in:
parent
155da59840
commit
c5f7c7f6a6
@ -309,12 +309,21 @@ public class Circuit {
|
|||||||
if (veIt.next().matches(min, max))
|
if (veIt.next().matches(min, max))
|
||||||
veIt.remove();
|
veIt.remove();
|
||||||
|
|
||||||
|
boolean wireDeleted = false;
|
||||||
Iterator<Wire> wIt = wires.iterator();
|
Iterator<Wire> wIt = wires.iterator();
|
||||||
while (wIt.hasNext()) {
|
while (wIt.hasNext()) {
|
||||||
Wire w = wIt.next();
|
Wire w = wIt.next();
|
||||||
if (w.p1.inside(min, max) || w.p2.inside(min, max))
|
if (w.p1.inside(min, max) || w.p2.inside(min, max)) {
|
||||||
wIt.remove();
|
wIt.remove();
|
||||||
|
wireDeleted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wireDeleted) {
|
||||||
|
WireConsistencyChecker checker = new WireConsistencyChecker(wires);
|
||||||
|
wires = checker.check();
|
||||||
|
}
|
||||||
|
|
||||||
dotsPresent = false;
|
dotsPresent = false;
|
||||||
modified();
|
modified();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user