From 2fc62c55b889b0b533b17b2d4d9207f4b6c8b482 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Wed, 8 Mar 2017 14:02:13 +0100 Subject: fixes SVG.PointArray.size() which created NaN when the bbox of the point array had zero height/width (#625) fixes SVG.PointArray.size() which created NaN when the bbox of the point array had zero height/width * update changelog --- src/pointarray.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pointarray.js b/src/pointarray.js index fa87c4b..58166a3 100644 --- a/src/pointarray.js +++ b/src/pointarray.js @@ -87,8 +87,8 @@ SVG.extend(SVG.PointArray, { // recalculate position of all points according to new size for (i = this.value.length - 1; i >= 0; i--) { - this.value[i][0] = ((this.value[i][0] - box.x) * width) / box.width + box.x - this.value[i][1] = ((this.value[i][1] - box.y) * height) / box.height + box.y + if(box.width) this.value[i][0] = ((this.value[i][0] - box.x) * width) / box.width + box.x + if(box.height) this.value[i][1] = ((this.value[i][1] - box.y) * height) / box.height + box.y } return this -- cgit v1.2.3