diff options
author | Valentin <radu.v.valentin@me.com> | 2019-05-06 18:27:16 +0200 |
---|---|---|
committer | Valentin <radu.v.valentin@me.com> | 2019-05-06 18:27:16 +0200 |
commit | 557f458aec9bb45182117b1366ca824f087129f0 (patch) | |
tree | 8be0af699f699adb7e0c7a3acd3106c9d136112e /src/types | |
parent | 1938355670b6dc9acf29199fb381e51bf1b72a70 (diff) | |
download | svg.js-557f458aec9bb45182117b1366ca824f087129f0.tar.gz svg.js-557f458aec9bb45182117b1366ca824f087129f0.zip |
Fixed path transformation when box width or height is 0
Diffstat (limited to 'src/types')
-rw-r--r-- | src/types/PathArray.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/types/PathArray.js b/src/types/PathArray.js index 764d05c..affd853 100644 --- a/src/types/PathArray.js +++ b/src/types/PathArray.js @@ -182,6 +182,11 @@ extend(PathArray, { var box = this.bbox() var i, l + // If the box width or height is 0 then we ignore + // transformations on the respective axis + box.width = box.width === 0 ? 1 : box.width + box.height = box.height === 0 ? 1 : box.height + // recalculate position of all points according to new size for (i = this.length - 1; i >= 0; i--) { l = this[i][0] |