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 Apr 14, 2016
1 parent 5fe6a25 commit d09c8c1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
};
Expand Down

0 comments on commit d09c8c1

Please sign in to comment.