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 Feb 22, 2016
1 parent 0b442b7 commit b682594
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 b682594

Please sign in to comment.