Skip to content

Commit

Permalink
Fetch max-width from CSSStyle if width is undefined.
Browse files Browse the repository at this point in the history
This may cause potential issues as max-width is not fully implemented in css-layout.
Refer to facebook/react-native#4644
  • Loading branch information
YorkShen committed Apr 14, 2016
1 parent 38ef066 commit f072c2e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public void measure(CSSNode node, float width, MeasureOutput measureOutput) {
.isBoring(text, textPaint);
float desiredWidth = boring == null ? Layout.getDesiredWidth(text,
textPaint) : Float.NaN;

if(CSSConstants.isUndefined(width)){
width=node.cssstyle.maxWidth;
}
if (boring == null
&& (CSSConstants.isUndefined(width) || (!CSSConstants
.isUndefined(desiredWidth) && desiredWidth <= width))) {
Expand Down

0 comments on commit f072c2e

Please sign in to comment.