/// <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 double ParseLength(string length, double hundredPercent, CssBoxProperties box, string defaultUnit) { return ParseLength(length, hundredPercent, box.GetEmHeight(), defaultUnit, false, 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="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 double ParseLength(string length, double hundredPercent, CssBoxProperties box, bool fontAdjust = false) { return ParseLength(length, hundredPercent, box.GetEmHeight(), null, fontAdjust, false); }