Skip to content

Commit

Permalink
fix: add isNil check
Browse files Browse the repository at this point in the history
  • Loading branch information
neuqzxy committed Nov 22, 2024
1 parent 1620703 commit 31c1f66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vutils/src/graphics/text/measure/textMeasure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ export class TextMeasure<T extends Partial<ITextMeasureSpec>> {
}
totalSize.width += size.width;
totalSize.height = Math.max(totalSize.height, size.height);
totalSize.fontBoundingBoxAscent = size.fontBoundingBoxAscent;
totalSize.fontBoundingBoxDescent = size.fontBoundingBoxDescent;
!isNil(size.fontBoundingBoxAscent) && (totalSize.fontBoundingBoxAscent = size.fontBoundingBoxAscent);
!isNil(size.fontBoundingBoxDescent) && (totalSize.fontBoundingBoxDescent = size.fontBoundingBoxDescent);
}
return totalSize;
}
Expand Down

0 comments on commit 31c1f66

Please sign in to comment.