Skip to content

Commit 3961716

Browse files
committed
fix(canvas): ios missing StaticLayout.getLineWidth
1 parent 1cd1b7e commit 3961716

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/ui-canvas/canvas.ios.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,6 +2451,16 @@ export class StaticLayout {
24512451
}
24522452
return result;
24532453
}
2454+
getLineWidth(lineNumber: number) {
2455+
// TODO: actually find line used width
2456+
let result = this.getBounds().size.width;
2457+
if (isNaN(result)) {
2458+
result = this.width;
2459+
} else {
2460+
result = Math.min(result, this.width);
2461+
}
2462+
return result;
2463+
}
24542464
getHeight() {
24552465
const result = this.getBounds().size.height;
24562466
return result;

0 commit comments

Comments
 (0)