public bool Equals(RectangleFloat other, float epsilon) { return(Math.Abs(Left - other.Left) <= epsilon && Math.Abs(Bottom - other.Bottom) <= epsilon && Math.Abs(Right - other.Right) <= epsilon && Math.Abs(Top - other.Top) <= epsilon); }
public bool IntersectWithRectangle(RectangleFloat rectToIntersectWith) { if (Left < rectToIntersectWith.Left) { Left = rectToIntersectWith.Left; } if (Bottom < rectToIntersectWith.Bottom) { Bottom = rectToIntersectWith.Bottom; } if (Right > rectToIntersectWith.Right) { Right = rectToIntersectWith.Right; } if (Top > rectToIntersectWith.Top) { Top = rectToIntersectWith.Top; } if (Left < Right && Bottom < Top) { return(true); } return(false); }
public bool Contains(RectangleFloat innerRect) { if (Contains(innerRect.Left, innerRect.Bottom) && Contains(innerRect.Right, innerRect.Top)) { return(true); } return(false); }
public void ExpandToInclude(RectangleFloat rectToInclude) { if (Right < rectToInclude.Right) { Right = rectToInclude.Right; } if (Top < rectToInclude.Top) { Top = rectToInclude.Top; } if (Left > rectToInclude.Left) { Left = rectToInclude.Left; } if (Bottom > rectToInclude.Bottom) { Bottom = rectToInclude.Bottom; } }
public bool clip(RectangleFloat r) { if (Right > r.Right) { Right = r.Right; } if (Top > r.Top) { Top = r.Top; } if (Left < r.Left) { Left = r.Left; } if (Bottom < r.Bottom) { Bottom = r.Bottom; } return(Left <= Right && Bottom <= Top); }
public void unite_rectangles(RectangleFloat r1, RectangleFloat r2) { Left = r1.Left; Bottom = r1.Bottom; Right = r1.Right; Right = r1.Top; if (Right < r2.Right) { Right = r2.Right; } if (Top < r2.Top) { Top = r2.Top; } if (Left > r2.Left) { Left = r2.Left; } if (Bottom > r2.Bottom) { Bottom = r2.Bottom; } }
public bool Equals(RectangleFloat other, float epsilon) { return Math.Abs(Left - other.Left) <= epsilon && Math.Abs(Bottom - other.Bottom) <= epsilon && Math.Abs(Right - other.Right) <= epsilon && Math.Abs(Top - other.Top) <= epsilon; }
public void ExpandToInclude(RectangleFloat rectToInclude) { if (Right < rectToInclude.Right) Right = rectToInclude.Right; if (Top < rectToInclude.Top) Top = rectToInclude.Top; if (Left > rectToInclude.Left) Left = rectToInclude.Left; if (Bottom > rectToInclude.Bottom) Bottom = rectToInclude.Bottom; }
public void unite_rectangles(RectangleFloat r1, RectangleFloat r2) { Left = r1.Left; Bottom = r1.Bottom; Right = r1.Right; Right = r1.Top; if (Right < r2.Right) Right = r2.Right; if (Top < r2.Top) Top = r2.Top; if (Left > r2.Left) Left = r2.Left; if (Bottom > r2.Bottom) Bottom = r2.Bottom; }
public bool IntersectWithRectangle(RectangleFloat rectToIntersectWith) { if (Left < rectToIntersectWith.Left) Left = rectToIntersectWith.Left; if (Bottom < rectToIntersectWith.Bottom) Bottom = rectToIntersectWith.Bottom; if (Right > rectToIntersectWith.Right) Right = rectToIntersectWith.Right; if (Top > rectToIntersectWith.Top) Top = rectToIntersectWith.Top; if (Left < Right && Bottom < Top) { return true; } return false; }
public bool Contains(RectangleFloat innerRect) { if (Contains(innerRect.Left, innerRect.Bottom) && Contains(innerRect.Right, innerRect.Top)) { return true; } return false; }
public bool clip(RectangleFloat r) { if (Right > r.Right) Right = r.Right; if (Top > r.Top) Top = r.Top; if (Left < r.Left) Left = r.Left; if (Bottom < r.Bottom) Bottom = r.Bottom; return Left <= Right && Bottom <= Top; }