Fixed Link force jiggling

This commit is contained in:
Pitchaya Boonsarngsuk
2018-01-24 21:14:09 +00:00
parent 3d55117977
commit 7c63fec0f7
2 changed files with 1 additions and 2 deletions

View File

@@ -45,7 +45,7 @@ export default function(links) {
x = target.x + target.vx - source.x - source.vx || jiggle();
y = target.y + target.vy - source.y - source.vy || jiggle();
l = Math.sqrt(x * x + y * y);
l = (l - distances[i]) / l * alpha/* * strengths[i]*/;
l = (l - distances[i]) / l * alpha * strengths[i];
x *= l, y *= l;
target.vx -= x * (b = bias[i]);
target.vy -= y * b;