示例#1
0
 /// <summary>
 /// Parses a length. Lengths are followed by an unit identifier (e.g. 10px, 3.1em)
 /// </summary>
 /// <param name="length">Specified length</param>
 /// <param name="hundredPercent">Equivalent to 100 percent when length is percentage</param>
 /// <param name="fontAdjust">if the length is in pixels and the length is font related it needs to use 72/96 factor</param>
 /// <param name="box"></param>
 /// <returns>the parsed length value with adjustments</returns>
 public static float ParseLength(string length, float hundredPercent, CssBoxProperties box, bool fontAdjust = false)
 {
     return ParseLength(length, hundredPercent, box.GetEmHeight(), fontAdjust, false);
 }
 /// <summary>
 /// Parses a length. Lengths are followed by an unit identifier (e.g. 10px, 3.1em)
 /// </summary>
 /// <param name="length">Specified length</param>
 /// <param name="hundredPercent">Equivalent to 100 percent when length is percentage</param>
 /// <param name="box"></param>
 /// <param name="defaultUnit"></param>
 /// <returns>the parsed length value with adjustments</returns>
 public static float ParseLength(string length, float hundredPercent, CssBoxProperties box, string defaultUnit)
 {
     return ParseLength(length, hundredPercent, box.GetEmHeight(), defaultUnit, false, false);
 }