Browse Source

A fix calculating the size of a node when the range is empty

css_transitions
josdejong 11 years ago
parent
commit
1b2292c1da
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/graph/Node.js

+ 5
- 0
src/graph/Node.js View File

@ -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;
}
}
};

Loading…
Cancel
Save