From 830fe47776fa591f988dcaa50e4bc2209c528055 Mon Sep 17 00:00:00 2001 From: Rene Heindl Date: Tue, 17 Feb 2015 11:33:54 +0100 Subject: [PATCH] Changed resizing for icons --- lib/network/Node.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); } };