diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-03-08 14:02:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-08 14:02:13 +0100 |
commit | 2fc62c55b889b0b533b17b2d4d9207f4b6c8b482 (patch) | |
tree | b57b2eeeb1a6d53a9ae117d6a663c57ef77e9e37 /src | |
parent | 1f16a667e195bc2dc19084ea8a486eedf2742bb1 (diff) | |
download | svg.js-2fc62c55b889b0b533b17b2d4d9207f4b6c8b482.tar.gz svg.js-2fc62c55b889b0b533b17b2d4d9207f4b6c8b482.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/pointarray.js | 4 |
1 files changed, 2 insertions, 2 deletions
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 |