Пример #1
0
 static void appendNumberIfNotAuto(
     StringBuilder sb,
     string key,
     YGValue number)
 {
     if (number.unit != YGUnit.Auto)
     {
         appendNumberIfNotUndefined(sb, key, number);
     }
 }
Пример #2
0
 static void appendNumberIfNotZero(
     StringBuilder sb,
     string str,
     YGValue number)
 {
     if (number.unit == YGUnit.Auto)
     {
         sb.Append(str + ": auto; ");
     }
     else if (!YGFloatsEqual(number.value, 0))
     {
         appendNumberIfNotUndefined(sb, str, number);
     }
 }
Пример #3
0
        static void appendNumberIfNotUndefined(
            StringBuilder sb,
            string key,
            YGValue number)
        {
            if (number.unit == YGUnit.Undefined)
            {
                return;
            }

            if (number.unit == YGUnit.Auto)
            {
                sb.Append($"{key}: auto; ");
            }
            else
            {
                sb.Append($"{key}: {number}; ");
            }
        }
Пример #4
0
        public bool Equals(YGValue other)
        {
            if (unit != other.unit)
            {
                return(false);
            }

            switch (unit)
            {
            case YGUnit.Undefined:
            case YGUnit.Auto:
                return(true);

            case YGUnit.Point:
            case YGUnit.Percent:
                return
                    (value.Equals(other.value));
            }

            return(false);
        }
Пример #5
0
 public Dimensions(YGValue defaultValue) : base(defaultValue)
 {
 }
Пример #6
0
 public Edges(YGValue defaultValue) : base(defaultValue)
 {
 }
Пример #7
0
        public Values(YGValue defaultValue) : this()
        {
            var cv = new CompactValue(defaultValue);

            _values.Fill(cv);
        }