round up layoutWidth for Android 11 in ReactTextShadowNode

Summary:
in Android 11, there's an issue where Text content is being clipped. The root cause appears to be a breaking change in how Android 11 is measuring text. rounding up the layoutWidth calculation mitigates the issue.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D23944772

fbshipit-source-id: 1639259da1c2c507c6bfc80fed377577316febac
This commit is contained in:
Michael Yoon (LAX) 2020-09-25 19:04:29 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 920bd2c199
Коммит 1438543a2f
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -144,6 +144,9 @@ public class ReactTextShadowNode extends ReactBaseTextShadowNode {
}
}
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.Q) {
layoutWidth = (float) Math.ceil(layoutWidth);
}
float layoutHeight = height;
if (heightMode != YogaMeasureMode.EXACTLY) {
layoutHeight = layout.getLineBottom(lineCount - 1);