public FixRect(FixRect source) { this.l = source.l; this.t = source.t; this.w = source.w; this.h = source.h; }
public override bool Equals(object other) { if (!(other is FixRect)) { return(false); } FixRect rect = (FixRect)other; return(((this.x.Equals(rect.x) && this.y.Equals(rect.y)) && this.width.Equals(rect.width)) && this.height.Equals(rect.height)); }
public bool Overlaps(FixRect other, bool allowInverse) { FixRect rect = this; if (allowInverse) { rect = OrderMinMax(rect); other = OrderMinMax(other); } return(rect.Overlaps(other)); }
private static FixRect OrderMinMax(FixRect rect) { if (rect.xMin > rect.xMax) { int xMin = rect.xMin; rect.xMin = rect.xMax; rect.xMax = xMin; } if (rect.yMin > rect.yMax) { int yMin = rect.yMin; rect.yMin = rect.yMax; rect.yMax = yMin; } return(rect); }
public bool Overlaps(FixRect other) { return((((other.xMax > this.xMin) && (other.xMin < this.xMax)) && (other.yMax > this.yMin)) && (other.yMin < this.yMax)); }