diff --git a/lib/network/Node.js b/lib/network/Node.js index e2270121..0c35d9a2 100644 --- a/lib/network/Node.js +++ b/lib/network/Node.js @@ -1015,19 +1015,19 @@ Node.prototype._drawText = function (ctx) { Node.prototype._resizeIcon = function (ctx) { if (!this.width) { var margin = 5; - var textSize = + var iconSize = { - width: 1, + width: Number(this.options.iconSize), height: Number(this.options.iconSize) + 4 }; - this.width = textSize.width + 2 * margin; - this.height = textSize.height + 2 * margin; + this.width = iconSize.width + 2 * margin; + this.height = iconSize.height + 2 * margin; // scaling used for clustering this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeWidthFactor; this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeHeightFactor; this.options.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeRadiusFactor; - this.growthIndicator = this.width - (textSize.width + 2 * margin); + this.growthIndicator = this.width - (iconSize.width + 2 * margin); } };