Use layout padding instead of style padding

Reviewed By: javache

Differential Revision: D4377071

fbshipit-source-id: c4a534a07f335c39ec50214e33a41aeff0389bf1
This commit is contained in:
Emil Sjolander 2017-01-06 06:39:32 -08:00 committed by Facebook Github Bot
parent ef9e855692
commit 828addcf55
1 changed files with 6 additions and 23 deletions

View File

@ -491,29 +491,12 @@ RCT_PADDING_PROPERTY(Right, RIGHT)
- (UIEdgeInsets)paddingAsInsets
{
if (YGNodeLayoutGetDirection(_cssNode) == YGDirectionRTL) {
return (UIEdgeInsets){
YGNodeStyleGetPadding(_cssNode, YGEdgeTop).value,
YGNodeStyleGetPadding(_cssNode, YGEdgeEnd).unit == YGUnitPixel ?
YGNodeStyleGetPadding(_cssNode, YGEdgeEnd).value :
YGNodeStyleGetPadding(_cssNode, YGEdgeLeft).value,
YGNodeStyleGetPadding(_cssNode, YGEdgeBottom).value,
YGNodeStyleGetPadding(_cssNode, YGEdgeStart).unit == YGUnitPixel ?
YGNodeStyleGetPadding(_cssNode, YGEdgeStart).value :
YGNodeStyleGetPadding(_cssNode, YGEdgeRight).value
};
} else {
return (UIEdgeInsets){
YGNodeStyleGetPadding(_cssNode, YGEdgeTop).value,
YGNodeStyleGetPadding(_cssNode, YGEdgeStart).unit == YGUnitPixel ?
YGNodeStyleGetPadding(_cssNode, YGEdgeStart).value :
YGNodeStyleGetPadding(_cssNode, YGEdgeLeft).value,
YGNodeStyleGetPadding(_cssNode, YGEdgeBottom).value,
YGNodeStyleGetPadding(_cssNode, YGEdgeEnd).unit == YGUnitPixel ?
YGNodeStyleGetPadding(_cssNode, YGEdgeEnd).value :
YGNodeStyleGetPadding(_cssNode, YGEdgeRight).value
};
}
return (UIEdgeInsets){
YGNodeLayoutGetPadding(_cssNode, YGEdgeTop),
YGNodeLayoutGetPadding(_cssNode, YGEdgeLeft),
YGNodeLayoutGetPadding(_cssNode, YGEdgeBottom),
YGNodeLayoutGetPadding(_cssNode, YGEdgeRight)
};
}
// Border