Consider negative border radii and widths invalid
Reviewed By: achen1 Differential Revision: D5998369 fbshipit-source-id: d54302777f4eeb13f4521800130c17ac07f1b354
This commit is contained in:
parent
bae9b2b206
commit
99d294bf3d
|
@ -73,6 +73,10 @@ public class ReactViewManager extends ViewGroupManager<ReactViewGroup> {
|
|||
defaultFloat = YogaConstants.UNDEFINED
|
||||
)
|
||||
public void setBorderRadius(ReactViewGroup view, int index, float borderRadius) {
|
||||
if (!YogaConstants.isUndefined(borderRadius) && borderRadius < 0) {
|
||||
borderRadius = YogaConstants.UNDEFINED;
|
||||
}
|
||||
|
||||
if (!YogaConstants.isUndefined(borderRadius)) {
|
||||
borderRadius = PixelUtil.toPixelFromDIP(borderRadius);
|
||||
}
|
||||
|
@ -153,9 +157,14 @@ public class ReactViewManager extends ViewGroupManager<ReactViewGroup> {
|
|||
defaultFloat = YogaConstants.UNDEFINED
|
||||
)
|
||||
public void setBorderWidth(ReactViewGroup view, int index, float width) {
|
||||
if (!YogaConstants.isUndefined(width) && width < 0) {
|
||||
width = YogaConstants.UNDEFINED;
|
||||
}
|
||||
|
||||
if (!YogaConstants.isUndefined(width)) {
|
||||
width = PixelUtil.toPixelFromDIP(width);
|
||||
}
|
||||
|
||||
view.setBorderWidth(SPACING_TYPES[index], width);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue