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:
Родитель
920bd2c199
Коммит
1438543a2f
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче