mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
920bd2c199
commit
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);
|
||||
|
||||
Reference in New Issue
Block a user