From 5571d9a46103621d9e29b8f13bd11cca683955bb 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 a47fa7669616f2..909d2565b0d974 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 @@ -274,7 +274,7 @@ public void measure( ? 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; } } };