Skip to content

Commit

Permalink
this is a workaround for Fam issue facebook#172 where text would be c…
Browse files Browse the repository at this point in the history
…ut 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.
  • Loading branch information
keithnorm committed Feb 12, 2016
1 parent f7ef5d0 commit 7c93863
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
};
Expand Down

0 comments on commit 7c93863

Please sign in to comment.