summaryrefslogtreecommitdiff
path: root/src/client/model/graph.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-07-30 18:01:08 +0300
committerAlon Levy <alon@pobox.com>2015-07-30 18:05:06 +0300
commit0af23f4638bbd87ccd886a988616effe58c73c4a (patch)
tree0d8f5eb1f7e42a98036b76a5b0d6cbfb0518ae24 /src/client/model/graph.js
parent2740bfa42ab844a0a3f9fdd9f4240420752ac9ce (diff)
client/model/graph: use eps, short for epsilon
Diffstat (limited to 'src/client/model/graph.js')
-rw-r--r--src/client/model/graph.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/model/graph.js b/src/client/model/graph.js
index ab9b5902..f7affb93 100644
--- a/src/client/model/graph.js
+++ b/src/client/model/graph.js
@@ -645,6 +645,8 @@ function Graph(spec) {
return Math.abs(a - b) < eps;
}
+ var eps = 0.001;
+
/**
* Do an attribute commit with x, y for the current layout
*/
@@ -662,7 +664,7 @@ function Graph(spec) {
x = node.x,
y = node.y;
- if (close_to(db_x, x, 0.0001) && close_to(db_y, y, 0.0001)) {
+ if (close_to(db_x, x, eps) && close_to(db_y, y, eps)) {
return;
}
node[x_key] = node.x;