Compare commits

...

2 Commits

Author SHA1 Message Date
Dominic Zimmer
562e2ea9dc Merge branch 'master' of leafbla.de:dominic/ResistorJS 2020-11-19 00:17:41 +01:00
Dominic Zimmer
7644a5cf30 Fix bug not collapsing NestedResistors 2020-11-19 00:17:39 +01:00
2 changed files with 2 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

View File

@ -47,7 +47,7 @@ class Resistor {
${svg}
</g>
</svg>`
element.innerHTML += thesvg;
element.innerHTML = thesvg;
}
}
@ -57,7 +57,7 @@ class NestedResistor extends Resistor {
constructor(l, func, instance) {
super(func(l.map(e => e.getOhmage())));
this.func = func
this.children = flatten(l, instance.constructor.name);
this.children = flatten(l, instance);
}
cost() {
return sum(this.children.map(e => e.cost()));