Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Revert "[Android] Change default value to from NAN to 0 (#2883)"
Browse files Browse the repository at this point in the history
This reverts commit 6daad9e.
  • Loading branch information
lucky-chen committed Sep 19, 2019
1 parent e2dc1bb commit fe41a75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions android/sdk/src/main/java/com/taobao/weex/dom/WXStyle.java
Expand Up @@ -158,7 +158,7 @@ public static int getFontSize(Map<String, Object> style,int viewPortW) {
if (style == null) {
return (int) WXViewUtils.getRealPxByWidth(WXText.sDEFAULT_SIZE,viewPortW);
}
int fontSize = (int) WXViewUtils.getRealPxByWidth(style.get(Constants.Name.FONT_SIZE), 0f,viewPortW);
int fontSize = (int) WXViewUtils.getRealPxByWidth(style.get(Constants.Name.FONT_SIZE),viewPortW);
if (fontSize <= 0) {
fontSize = WXText.sDEFAULT_SIZE;
}
Expand Down Expand Up @@ -213,7 +213,7 @@ public static int getLineHeight(Map<String, Object> style,int viewPortW){
if (style == null) {
return UNSET;
}
int lineHeight = (int)WXViewUtils.getRealPxByWidth(style.get(Constants.Name.LINE_HEIGHT), 0f,viewPortW);
int lineHeight = (int)WXViewUtils.getRealPxByWidth(style.get(Constants.Name.LINE_HEIGHT),viewPortW);
if (lineHeight <= 0) {
lineHeight = UNSET;
}
Expand Down
Expand Up @@ -300,7 +300,7 @@ private static float parsePercentOrPx(String raw, int unit, int viewportW) {
if ((suffix = raw.lastIndexOf(WXUtils.PERCENT)) != -1) {
return parsePercent(raw.substring(0, suffix), unit, precision);
}
return WXViewUtils.getRealPxByWidth(raw, 0f,viewportW);
return WXViewUtils.getRealPxByWidth(raw,viewportW);

}

Expand Down

0 comments on commit fe41a75

Please sign in to comment.