Change the type of flexShrink to YGFloatOptional

Summary: Change the type of flexShrink to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7232171

fbshipit-source-id: 3111119d3d74a7035c01132bff61b30cf44e120a
This commit is contained in:
Pritesh Nandgaonkar
2018-03-14 04:17:16 -07:00
committed by Facebook Github Bot
parent 8aadae8ce4
commit 877c275a13
5 changed files with 26 additions and 20 deletions

View File

@@ -44,7 +44,7 @@ YGStyle::YGStyle()
display(YGDisplayFlex),
flex(YGFloatOptionalUndefined),
flexGrow(YGFloatOptionalUndefined),
flexShrink(YGUndefined),
flexShrink(YGFloatOptionalUndefined),
flexBasis(kYGValueAuto),
margin(kYGDefaultEdgeValuesUnit),
position(kYGDefaultEdgeValuesUnit),
@@ -86,10 +86,11 @@ bool YGStyle::operator==(const YGStyle& style) {
areNonFloatValuesEqual && flexGrow.value == style.flexGrow.value;
}
if (!(YGFloatIsUndefined(flexShrink) &&
YGFloatIsUndefined(style.flexShrink))) {
areNonFloatValuesEqual = areNonFloatValuesEqual &&
flexShrink.isUndefined == style.flexShrink.isUndefined;
if (areNonFloatValuesEqual && !style.flexShrink.isUndefined) {
areNonFloatValuesEqual =
areNonFloatValuesEqual && flexShrink == style.flexShrink;
areNonFloatValuesEqual && flexShrink.value == style.flexShrink.value;
}
if (!(YGFloatIsUndefined(aspectRatio) &&