Skip to content

Commit a9ea2d8

Browse files
committed
fix(ios): StaticLayout fixed when height provided
1 parent 78d7a5a commit a9ea2d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ui-canvas/canvas.ios.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,7 +2373,8 @@ export class StaticLayout {
23732373
private spacingadd?,
23742374
private includepad?,
23752375
private ellipsize?,
2376-
private ellipsizedWidth?
2376+
private ellipsizedWidth?,
2377+
private height?
23772378
) {
23782379
if (text instanceof NSAttributedString) {
23792380
this.nsAttributedString = text;
@@ -2460,7 +2461,7 @@ export class StaticLayout {
24602461
CGContextTranslateCTM(ctx, offsetx, 0);
24612462
}
24622463
this.mToDraw.drawWithRectOptionsContext(
2463-
CGRectMake(0, 0, this.width, maxHeight),
2464+
CGRectMake(0, 0, this.width, Math.min(maxHeight, this.height || Number.MAX_VALUE)),
24642465
NSStringDrawingOptions.UsesLineFragmentOrigin | NSStringDrawingOptions.TruncatesLastVisibleLine | NSStringDrawingOptions.UsesFontLeading,
24652466
null
24662467
);

0 commit comments

Comments
 (0)