Esempio n. 1
0
        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;
        }
Esempio n. 2
0
 static void appendFloatOptionalIfDefined(
     StringBuilder sb,
     string key,
     YGFloatOptional num)
 {
     if (!num.IsUndefined())
     {
         sb.Append($"{key}: {num.Unwrap():G}; ");
     }
 }
Esempio n. 3
0
        // 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());
 }