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 authored and drtangible committed Mar 8, 2016
1 parent a8e756a commit 4a7a407
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
};
Expand Down

0 comments on commit 4a7a407

Please sign in to comment.