From 1a622da784c2a363e3d9f62c70a493338217c3e2 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Thu, 7 Jun 2012 03:19:31 +0200 Subject: [PATCH] smaller bounding box --- html/force.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/html/force.js b/html/force.js index 956fb08..21a5f0c 100644 --- a/html/force.js +++ b/html/force.js @@ -170,10 +170,10 @@ force.on("tick", function() { for (i = 0; i < n; i++) { var o = nodes[i] if (!o.fixed) { - if (o.x < 0) o.x = 10 - if (o.x > size[0]) o.x = size[0] - 10 - if (o.y < 0) o.y = 10 - if (o.y > size[1]) o.y = size[1] - 10 + if (o.x < 10) o.x = 10 + if (o.x > size[0] - 10) o.x = size[0] - 10 + if (o.y < 10) o.y = 10 + if (o.y > size[1] - 10) o.y = size[1] - 10 } }