mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 18:03:58 +00:00
overlap from lines
This commit is contained in:
@@ -350,9 +350,8 @@ export class ForceDirectedLayout {
|
|||||||
});
|
});
|
||||||
if (overlaps.length == 2) {
|
if (overlaps.length == 2) {
|
||||||
const mid = new Vector((overlaps[0].x + overlaps[1].x) / 2, (overlaps[0].y + overlaps[1].y) / 2);
|
const mid = new Vector((overlaps[0].x + overlaps[1].x) / 2, (overlaps[0].y + overlaps[1].y) / 2);
|
||||||
var direction = point.position.subtract(mid); // .multiply(-1.0);
|
const direction = point.position.subtract(mid);
|
||||||
// console.log('OVERLAP', direction);
|
point.applyForce(direction.normalise().multiply(this.repulsion / (direction.magnitude() + 1)));
|
||||||
point.applyForce(direction.multiply(this.repulsion));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user