Fix major bug in layout iteration
This commit is contained in:
@@ -125,11 +125,15 @@ class Layout {
|
||||
if (obj.offsetCollides(offset)) {
|
||||
continue;
|
||||
}
|
||||
obj.savePos();
|
||||
for (let obj of objects) {
|
||||
obj.savePos();
|
||||
}
|
||||
obj.moveBy(offset);
|
||||
this.setTension(objects);
|
||||
let testTension = this.getTotalTension(objects);
|
||||
obj.restorePos();
|
||||
for (let obj of objects) {
|
||||
obj.restorePos();
|
||||
}
|
||||
if (testTension < baseTension) {
|
||||
obj.moveBy(offset);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user