Skip to content

Commit bb95a1f

Browse files
committed
fix(text): repair tests
1 parent d8684e3 commit bb95a1f

6 files changed

Lines changed: 11 additions & 11 deletions
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

src/shapes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export class Text extends Shape {
333333
const [writtenText, fontsize] = this.formatInBoundingBox(context);
334334
this.fontsize = Math.abs(fontsize);
335335
this.height = writtenText.length * this.fontsize;
336-
this.width = this.getLongestRow(context, writtenText);
336+
this.width = this.fontsize > 1 ? this.getLongestRow(context, writtenText) : this.boundingBox.size.x ?? this.getLongestRow(context, writtenText);
337337
this.rowIndices = this.computeRowIndices(writtenText);
338338
return writtenText
339339
}

0 commit comments

Comments
 (0)