/// <summary> /// Change unit of the size and recalculate height and width /// </summary> /// <param name="unit">New unit</param> public PdfSize ChangeUnits(PdfUnit unit) { var ratio = Unit.Points / unit.Points; var result = new PdfSize(unit, Height * ratio, Width * ratio); return(result); }
public bool Equals(PdfSize other) { if (other == null) { return(false); } return(Math.Abs(this.Height - other.Height) < double.Epsilon && Math.Abs(this.Width - other.Width) < double.Epsilon && ((this.Unit == null) ? (other.Unit == null) : this.Unit.Equals(other.Unit))); }