mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Replace YogaConstants.UNDEFINED with Float.NaN (#45141)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45141 Reviewed By: javache, NickGerleman Differential Revision: D58915391 fbshipit-source-id: 73ebee6abaced092366abdfc0ff41a66e7ff6c03
This commit is contained in:
committed by
Facebook GitHub Bot
parent
993f9fd8db
commit
8bd9952eaf
+2
-2
@@ -330,7 +330,7 @@ public class LayoutShadowNode extends ReactShadowNodeImpl {
|
||||
flexBasis.recycle();
|
||||
}
|
||||
|
||||
@ReactProp(name = ViewProps.ASPECT_RATIO, defaultFloat = YogaConstants.UNDEFINED)
|
||||
@ReactProp(name = ViewProps.ASPECT_RATIO, defaultFloat = Float.NaN)
|
||||
public void setAspectRatio(float aspectRatio) {
|
||||
setStyleAspectRatio(aspectRatio);
|
||||
}
|
||||
@@ -863,7 +863,7 @@ public class LayoutShadowNode extends ReactShadowNodeImpl {
|
||||
ViewProps.BORDER_LEFT_WIDTH,
|
||||
ViewProps.BORDER_RIGHT_WIDTH,
|
||||
},
|
||||
defaultFloat = YogaConstants.UNDEFINED)
|
||||
defaultFloat = Float.NaN)
|
||||
public void setBorderWidths(int index, float borderWidth) {
|
||||
if (isVirtual()) {
|
||||
return;
|
||||
|
||||
+2
-3
@@ -24,7 +24,6 @@ import com.facebook.react.uimanager.ThemedReactContext;
|
||||
import com.facebook.react.uimanager.ViewProps;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
import com.facebook.yoga.YogaConstants;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -190,9 +189,9 @@ public class ReactImageManager extends SimpleViewManager<ReactImageView> {
|
||||
ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
|
||||
ViewProps.BORDER_BOTTOM_LEFT_RADIUS
|
||||
},
|
||||
defaultFloat = YogaConstants.UNDEFINED)
|
||||
defaultFloat = Float.NaN)
|
||||
public void setBorderRadius(ReactImageView view, int index, float borderRadius) {
|
||||
if (!YogaConstants.isUndefined(borderRadius)) {
|
||||
if (!Float.isNaN(borderRadius)) {
|
||||
borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -255,9 +255,9 @@ public class ReactHorizontalScrollViewManager extends ViewGroupManager<ReactHori
|
||||
ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
|
||||
ViewProps.BORDER_BOTTOM_LEFT_RADIUS
|
||||
},
|
||||
defaultFloat = YogaConstants.UNDEFINED)
|
||||
defaultFloat = Float.NaN)
|
||||
public void setBorderRadius(ReactHorizontalScrollView view, int index, float borderRadius) {
|
||||
if (!YogaConstants.isUndefined(borderRadius)) {
|
||||
if (!Float.isNaN(borderRadius)) {
|
||||
borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
|
||||
}
|
||||
|
||||
@@ -281,9 +281,9 @@ public class ReactHorizontalScrollViewManager extends ViewGroupManager<ReactHori
|
||||
ViewProps.BORDER_TOP_WIDTH,
|
||||
ViewProps.BORDER_BOTTOM_WIDTH,
|
||||
},
|
||||
defaultFloat = YogaConstants.UNDEFINED)
|
||||
defaultFloat = Float.NaN)
|
||||
public void setBorderWidth(ReactHorizontalScrollView view, int index, float width) {
|
||||
if (!YogaConstants.isUndefined(width)) {
|
||||
if (!Float.isNaN(width)) {
|
||||
width = PixelUtil.toPixelFromDIP(width);
|
||||
}
|
||||
view.setBorderWidth(SPACING_TYPES[index], width);
|
||||
|
||||
+4
-4
@@ -236,9 +236,9 @@ public class ReactScrollViewManager extends ViewGroupManager<ReactScrollView>
|
||||
ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
|
||||
ViewProps.BORDER_BOTTOM_LEFT_RADIUS
|
||||
},
|
||||
defaultFloat = YogaConstants.UNDEFINED)
|
||||
defaultFloat = Float.NaN)
|
||||
public void setBorderRadius(ReactScrollView view, int index, float borderRadius) {
|
||||
if (!YogaConstants.isUndefined(borderRadius)) {
|
||||
if (!Float.isNaN(borderRadius)) {
|
||||
borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
|
||||
}
|
||||
|
||||
@@ -262,9 +262,9 @@ public class ReactScrollViewManager extends ViewGroupManager<ReactScrollView>
|
||||
ViewProps.BORDER_TOP_WIDTH,
|
||||
ViewProps.BORDER_BOTTOM_WIDTH,
|
||||
},
|
||||
defaultFloat = YogaConstants.UNDEFINED)
|
||||
defaultFloat = Float.NaN)
|
||||
public void setBorderWidth(ReactScrollView view, int index, float width) {
|
||||
if (!YogaConstants.isUndefined(width)) {
|
||||
if (!Float.isNaN(width)) {
|
||||
width = PixelUtil.toPixelFromDIP(width);
|
||||
}
|
||||
view.setBorderWidth(SPACING_TYPES[index], width);
|
||||
|
||||
+4
-4
@@ -137,9 +137,9 @@ public abstract class ReactTextAnchorViewManager<T extends View, C extends React
|
||||
ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
|
||||
ViewProps.BORDER_BOTTOM_LEFT_RADIUS
|
||||
},
|
||||
defaultFloat = YogaConstants.UNDEFINED)
|
||||
defaultFloat = Float.NaN)
|
||||
public void setBorderRadius(ReactTextView view, int index, float borderRadius) {
|
||||
if (!YogaConstants.isUndefined(borderRadius)) {
|
||||
if (!Float.isNaN(borderRadius)) {
|
||||
borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
|
||||
}
|
||||
|
||||
@@ -163,9 +163,9 @@ public abstract class ReactTextAnchorViewManager<T extends View, C extends React
|
||||
ViewProps.BORDER_TOP_WIDTH,
|
||||
ViewProps.BORDER_BOTTOM_WIDTH,
|
||||
},
|
||||
defaultFloat = YogaConstants.UNDEFINED)
|
||||
defaultFloat = Float.NaN)
|
||||
public void setBorderWidth(ReactTextView view, int index, float width) {
|
||||
if (!YogaConstants.isUndefined(width)) {
|
||||
if (!Float.isNaN(width)) {
|
||||
width = PixelUtil.toPixelFromDIP(width);
|
||||
}
|
||||
view.setBorderWidth(SPACING_TYPES[index], width);
|
||||
|
||||
+4
-4
@@ -957,9 +957,9 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
||||
ViewProps.BORDER_BOTTOM_RIGHT_RADIUS,
|
||||
ViewProps.BORDER_BOTTOM_LEFT_RADIUS
|
||||
},
|
||||
defaultFloat = YogaConstants.UNDEFINED)
|
||||
defaultFloat = Float.NaN)
|
||||
public void setBorderRadius(ReactEditText view, int index, float borderRadius) {
|
||||
if (!YogaConstants.isUndefined(borderRadius)) {
|
||||
if (!Float.isNaN(borderRadius)) {
|
||||
borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
|
||||
}
|
||||
|
||||
@@ -1007,9 +1007,9 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
|
||||
ViewProps.BORDER_TOP_WIDTH,
|
||||
ViewProps.BORDER_BOTTOM_WIDTH,
|
||||
},
|
||||
defaultFloat = YogaConstants.UNDEFINED)
|
||||
defaultFloat = Float.NaN)
|
||||
public void setBorderWidth(ReactEditText view, int index, float width) {
|
||||
if (!YogaConstants.isUndefined(width)) {
|
||||
if (!Float.isNaN(width)) {
|
||||
width = PixelUtil.toPixelFromDIP(width);
|
||||
}
|
||||
view.setBorderWidth(SPACING_TYPES[index], width);
|
||||
|
||||
+4
-4
@@ -219,13 +219,13 @@ public class ReactViewManager extends ReactClippingViewManager<ReactViewGroup> {
|
||||
ViewProps.BORDER_START_WIDTH,
|
||||
ViewProps.BORDER_END_WIDTH,
|
||||
},
|
||||
defaultFloat = YogaConstants.UNDEFINED)
|
||||
defaultFloat = Float.NaN)
|
||||
public void setBorderWidth(ReactViewGroup view, int index, float width) {
|
||||
if (!YogaConstants.isUndefined(width) && width < 0) {
|
||||
width = YogaConstants.UNDEFINED;
|
||||
if (!Float.isNaN(width) && width < 0) {
|
||||
width = Float.NaN;
|
||||
}
|
||||
|
||||
if (!YogaConstants.isUndefined(width)) {
|
||||
if (!Float.isNaN(width)) {
|
||||
width = PixelUtil.toPixelFromDIP(width);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user