Beispiel #1
0
 static void appendNumberIfNotAuto(
     StringBuilder sb,
     string key,
     YGValue number)
 {
     if (number.unit != YGUnit.Auto)
     {
         appendNumberIfNotUndefined(sb, key, number);
     }
 }
Beispiel #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);
     }
 }
Beispiel #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}; ");
            }
        }
Beispiel #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);
        }
 public Dimensions(YGValue defaultValue) : base(defaultValue)
 {
 }
 public Edges(YGValue defaultValue) : base(defaultValue)
 {
 }
Beispiel #7
0
        public Values(YGValue defaultValue) : this()
        {
            var cv = new CompactValue(defaultValue);

            _values.Fill(cv);
        }