From 1b2292c1da9b640d64bc8b0e1d19d50509d290f9 Mon Sep 17 00:00:00 2001 From: josdejong Date: Fri, 20 Sep 2013 18:09:28 +0200 Subject: [PATCH] A fix calculating the size of a node when the range is empty --- src/graph/Node.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/graph/Node.js b/src/graph/Node.js index 36fb87bb..edb10a6c 100644 --- a/src/graph/Node.js +++ b/src/graph/Node.js @@ -397,8 +397,13 @@ Node.prototype.getDistance = function(x, y) { */ Node.prototype.setValueRange = function(min, max) { if (!this.radiusFixed && this.value !== undefined) { + if (max == min) { + this.radius = (this.radiusMin + this.radiusMax) / 2; + } + else { var scale = (this.radiusMax - this.radiusMin) / (max - min); this.radius = (this.value - min) * scale + this.radiusMin; + } } };