From 557f458aec9bb45182117b1366ca824f087129f0 Mon Sep 17 00:00:00 2001 From: Valentin Date: Mon, 6 May 2019 18:27:16 +0200 Subject: Fixed path transformation when box width or height is 0 --- src/types/PathArray.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/types') 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] -- cgit v1.2.3