From d09c8c19df3988da9e4bffe60d36bee58d4fb7bc 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 36996a1f8f5792..786b3bc6bcfc5c 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 @@ -257,7 +257,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; } } };