Simplify nodesByPos fixup
This commit is contained in:
@@ -97,15 +97,10 @@ class Layout {
|
||||
continue;
|
||||
}
|
||||
obj.savePos();
|
||||
let nodesByPos = Array.from(this.nodesByPos_);
|
||||
obj.moveBy(offset);
|
||||
this.setTension(objects);
|
||||
let testTension = this.getTotalTension(objects);
|
||||
obj.restorePos();
|
||||
this.nodesByPos_.clear();
|
||||
for (let [k, v] of nodesByPos) {
|
||||
this.nodesByPos_.set(k, v);
|
||||
}
|
||||
if (testTension < newTension) {
|
||||
newOffset = offset;
|
||||
newTension = testTension;
|
||||
|
||||
Reference in New Issue
Block a user