public YGStyle(YGStyle other) { direction = other.direction; flexDirection = other.flexDirection; justifyContent = other.justifyContent; alignContent = other.alignContent; alignItems = other.alignItems; alignSelf = other.alignSelf; positionType = other.positionType; flexWrap = other.flexWrap; overflow = other.overflow; display = other.display; flex = other.flex; flexGrow = other.flexGrow; flexShrink = other.flexShrink; flexBasis = other.flexBasis; margin = new Edges(other.margin); position = new Edges(other.position); padding = new Edges(other.padding); border = new Edges(other.border); dimensions = new Dimensions(other.dimensions); minDimensions = new Dimensions(other.minDimensions); maxDimensions = new Dimensions(other.maxDimensions); aspectRatio = other.aspectRatio; }
protected bool Equals(YGStyle other) { bool areNonFloatValuesEqual = direction == other.direction && flexDirection == other.flexDirection && justifyContent == other.justifyContent && alignContent == other.alignContent && alignItems == other.alignItems && alignSelf == other.alignSelf && positionType == other.positionType && flexWrap == other.flexWrap && overflow == other.overflow && display == other.display && YGGlobal.YGValueEqual(flexBasis, other.flexBasis) && margin == other.margin && position == other.position && padding == other.padding && border == other.border && dimensions == other.dimensions && minDimensions == other.minDimensions && maxDimensions == other.maxDimensions; areNonFloatValuesEqual = areNonFloatValuesEqual && flex.IsUndefined() == other.flex.IsUndefined(); if (areNonFloatValuesEqual && !flex.IsUndefined() && !other.flex.IsUndefined()) { areNonFloatValuesEqual = areNonFloatValuesEqual && flex == other.flex; } areNonFloatValuesEqual = areNonFloatValuesEqual && flexGrow.IsUndefined() == other.flexGrow.IsUndefined(); if (areNonFloatValuesEqual && !flexGrow.IsUndefined()) { areNonFloatValuesEqual = areNonFloatValuesEqual && flexGrow == other.flexGrow; } areNonFloatValuesEqual = areNonFloatValuesEqual && flexShrink.IsUndefined() == other.flexShrink.IsUndefined(); if (areNonFloatValuesEqual && !other.flexShrink.IsUndefined()) { areNonFloatValuesEqual = areNonFloatValuesEqual && flexShrink == other.flexShrink; } if (!(aspectRatio.IsUndefined() && other.aspectRatio.IsUndefined())) { areNonFloatValuesEqual = areNonFloatValuesEqual && aspectRatio == other.aspectRatio; } return(areNonFloatValuesEqual); }