Commit bb0dcf9
Fix BoringLayout crash when isBoring() returns negative width
Summary:
Fix a crash in `TextLayoutManager.isBoring()` where `BoringLayout.isBoring()` sometimes returns metrics with a negative width for certain strings, even on Android 15+. This causes issues downstream when the layout is created.
The fix checks if the returned metrics have a negative width and falls back to `StaticLayout` instead, which (theoretically) handles these edge cases correctly.
Changelog:
[Android][Fixed] - Fix BoringLayout crash when isBoring() returns negative width
Differential Revision: D957779081 parent 41a1941 commit bb0dcf9
File tree
1 file changed
+18
-8
lines changed- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text
1 file changed
+18
-8
lines changedLines changed: 18 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1376 | 1376 | | |
1377 | 1377 | | |
1378 | 1378 | | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
1382 | | - | |
1383 | | - | |
1384 | | - | |
1385 | | - | |
1386 | | - | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
1387 | 1397 | | |
1388 | 1398 | | |
1389 | 1399 | | |
| |||
0 commit comments