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];