From 4a7a407e9d2a4f5be39c71c88976b124527eb92a 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 2d98703c2f6756..e204dcc509688f 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 @@ -253,7 +253,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; } } };