From 9e39485e00de6c93d8cd98d33905e3e7b8d69bd6 Mon Sep 17 00:00:00 2001 From: Adam Greenan Date: Wed, 11 Dec 2024 13:37:28 +0000 Subject: [PATCH 1/2] Remove personal prettier changes --- src/shapes/Text.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/shapes/Text.ts b/src/shapes/Text.ts index 7097ca08..662fa5f2 100644 --- a/src/shapes/Text.ts +++ b/src/shapes/Text.ts @@ -309,8 +309,7 @@ export class Text extends Shape { context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset); spacesNumber = text.split(' ').length - 1; oneWord = spacesNumber === 0; - lineWidth = - align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width; + lineWidth = align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width; context.lineTo( lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + yOffset @@ -383,8 +382,7 @@ export class Text extends Shape { return isAuto ? this.getTextWidth() + this.padding() * 2 : this.attrs.width; } getHeight() { - const isAuto = - this.attrs.height === AUTO || this.attrs.height === undefined; + const isAuto = this.attrs.height === AUTO || this.attrs.height === undefined; return isAuto ? this.fontSize() * this.textArr.length * this.lineHeight() + this.padding() * 2 @@ -502,9 +500,7 @@ export class Text extends Shape { this.textArr = []; getDummyContext().font = this._getContextFont(); - const additionalWidth = shouldAddEllipsis - ? this._getTextWidth(ELLIPSIS) - : 0; + const additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0; for (let i = 0, max = lines.length; i < max; ++i) { let line = lines[i]; From 3e092392cca1200b6b5e837e473a4124ede32718 Mon Sep 17 00:00:00 2001 From: Adam Greenan Date: Wed, 11 Dec 2024 13:39:27 +0000 Subject: [PATCH 2/2] remove more personal prettier changes --- src/shapes/Text.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shapes/Text.ts b/src/shapes/Text.ts index 662fa5f2..ba8c2353 100644 --- a/src/shapes/Text.ts +++ b/src/shapes/Text.ts @@ -309,7 +309,8 @@ export class Text extends Shape { context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset); spacesNumber = text.split(' ').length - 1; oneWord = spacesNumber === 0; - lineWidth = align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width; + lineWidth = + align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width; context.lineTo( lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + yOffset