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