From b682594c00f0b3ffe402f61eb729719b5fc74173 Mon Sep 17 00:00:00 2001 From: Keith Norman Date: Fri, 12 Feb 2016 11:18:18 -0800 Subject: [PATCH] this is a workaround for Fam issue #172 where text would be cut off on some TextView's. It seems that the height reported via Layout and height expected based on lineHeight differ for single line text. This was the best workaround I could come up with after working on it for a day. --- .../java/com/facebook/react/views/text/ReactTextShadowNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java index 314df23ef3d551..455d270a11e094 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java @@ -269,7 +269,7 @@ public void measure(CSSNode node, float width, float height, MeasureOutput measu ? Math.min(reactCSSNode.mNumberOfLines, layout.getLineCount()) : layout.getLineCount(); float lineHeight = PixelUtil.toPixelFromSP(reactCSSNode.mLineHeight); - measureOutput.height = lineHeight * lines; + measureOutput.height = layout.getLineCount() == 1 ? layout.getHeight() : lineHeight * lines; } } };