Skip to content

Commit

Permalink
Tweak optimization layout (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
lidavidm committed Apr 7, 2018
1 parent 1f22fda commit 9033708
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ui/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,13 @@ export function optimizationPacking(stage, bounds, nodeIds) {
w: sz2.w,
h: sz2.h,
});
result += pairwiseDistance;
result += 1 / (1 + Math.abs(pairwiseDistance));
}

result += 1 / ((x1 - bounds.x) ** 2);
result += 1 / ((y1 - bounds.y) ** 2);
result += 1 / (((x1 + sz1.w) - (bounds.x + bounds.w)) ** 2);
result += 1 / (((y1 + sz1.h) - (bounds.y + bounds.h)) ** 2);
result += 1 / (((x1 - (sz1.w / 2)) - bounds.x) ** 2);
result += 1 / (((y1 - (sz1.h / 2)) - bounds.y) ** 2);
result += 1 / (((x1 + (sz1.w / 2)) - (bounds.x + bounds.w)) ** 2);
result += 1 / (((y1 + (sz1.h / 2)) - (bounds.y + bounds.h)) ** 2);
}

return result;
Expand Down

0 comments on commit 9033708

Please sign in to comment.