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; }
static void appendFloatOptionalIfDefined( StringBuilder sb, string key, YGFloatOptional num) { if (!num.IsUndefined()) { sb.Append($"{key}: {num.Unwrap():G}; "); } }
// If both left and right are defined, then use left. Otherwise return +left or // -right depending on which is defined. YGFloatOptional relativePosition( YGFlexDirection axis, float axisSize) { if (isLeadingPositionDefined(axis)) { return(getLeadingPosition(axis, axisSize)); } YGFloatOptional trailingPosition = getTrailingPosition(axis, axisSize); if (!trailingPosition.IsUndefined()) { trailingPosition = new YGFloatOptional(-1 * trailingPosition.Unwrap()); } return(trailingPosition); }
public bool Equals(YGFloatOptional other) { return(_value.Equals(other._value) || IsUndefined() && other.IsUndefined()); }