From 680c92220699f68ba030735e181714e2127c403c Mon Sep 17 00:00:00 2001 From: GrumpyW1zard <39481384+GrumpyW1zard@users.noreply.github.com> Date: Wed, 18 Sep 2019 10:16:02 +0200 Subject: [PATCH] casts radius and blur into float Casts radius and blur into float to prevent browser crash when using number in string format. --- simpleheat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simpleheat.js b/simpleheat.js index dc06eb9..23760ec 100644 --- a/simpleheat.js +++ b/simpleheat.js @@ -48,7 +48,8 @@ simpleheat.prototype = { }, radius: function (r, blur) { - blur = blur === undefined ? 15 : blur; + r = parseFloat(r); + blur = blur === undefined ? 15 : parseFloat(blur); // create a grayscale blurred circle image that we'll use for drawing points var circle = this._circle = this._createCanvas(),