public static PageRect RectFor(PageAddress addr) { PageRect ret = new PageRect(); ret.X = addr.X * Page.TileSizeUnits; ret.Z = addr.Z * Page.TileSizeUnits; ret.W = Page.TileSizeUnits; ret.H = Page.TileSizeUnits; return ret; }
public static PageRect RectFor(PageAddress addr) { PageRect ret = new PageRect(); ret.X = addr.X * Page.TileSizeUnits; ret.Z = addr.Z * Page.TileSizeUnits; ret.W = Page.TileSizeUnits; ret.H = Page.TileSizeUnits; return(ret); }
public void Union(PageRect r) { float NX = Math.Min(X, r.X); float NZ = Math.Min(Z, r.Z); float XM = Math.Max(X + W, r.X + r.W); float ZM = Math.Max(Z + H, r.Z + r.H); X = NX; Z = NZ; W = XM - X; H = ZM - Z; System.Diagnostics.Debug.Assert(W >= 0); System.Diagnostics.Debug.Assert(H >= 0); }
public void SetAddress(PageAddress addr, PageRect rect) { addr_ = addr; rect_ = rect; }