public TSRect(TSRect source) { this.mXMin = source.mXMin; this.mYMin = source.mYMin; this.mWidth = source.mWidth; this.mHeight = source.mHeight; }
public override bool Equals(object other) { if (!(other is TSRect)) { return(false); } TSRect vRect = (TSRect)other; return(this.x.Equals(vRect.x) && this.y.Equals(vRect.y) && this.width.Equals(vRect.width) && this.height.Equals(vRect.height)); }
public bool Overlaps(TSRect other, bool allowInverse) { TSRect rect = this; if (allowInverse) { rect = TSRect.OrderMinMax(rect); other = TSRect.OrderMinMax(other); } return(rect.Overlaps(other)); }
private static TSRect OrderMinMax(TSRect rect) { if (rect.xMin > rect.xMax) { FP xMin = rect.xMin; rect.xMin = rect.xMax; rect.xMax = xMin; } if (rect.yMin > rect.yMax) { FP yMin = rect.yMin; rect.yMin = rect.yMax; rect.yMax = yMin; } return(rect); }
public bool Overlaps(TSRect other) { return(other.xMax > this.xMin && other.xMin < this.xMax && other.yMax > this.yMin && other.yMin < this.yMax); }