Exemple #1
0
 public bool Equals(RectD other, double 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;
 }
Exemple #2
0
 public void unite_rectangles(RectD r1, RectD 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;
     }
 }
Exemple #3
0
 public static void FillRectangle(this AggRenderSurface gx, RectD rect, Color fillColor)
 {
     gx.FillRectangle(rect.Left, rect.Bottom, rect.Right, rect.Top, fillColor);
 }
Exemple #4
0
 public static void Rectangle(this AggRenderSurface gx, RectD rect, Color color, double strokeWidth = 1)
 {
     gx.Rectangle(rect.Left, rect.Bottom, rect.Right, rect.Top, color, strokeWidth);
 }
Exemple #5
0
 public void unite_rectangles(RectD r1, RectD 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;
 }
Exemple #6
0
 public void ExpandToInclude(RectD 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;
 }
Exemple #7
0
        public bool Contains(RectD innerRect)
        {
            if (Contains(innerRect.Left, innerRect.Bottom) && Contains(innerRect.Right, innerRect.Top))
            {
                return true;
            }

            return false;
        }
Exemple #8
0
        public bool IntersectWithRectangle(RectD 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 static void FillRectangle(this Graphics2D gx, RectD rect, ColorRGBA fillColor)
 {
     gx.FillRectangle(rect.Left, rect.Bottom, rect.Right, rect.Top, fillColor);
 }
Exemple #10
0
 public bool clip(RectD 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 static void Rectangle(this Graphics2D gx, RectD rect, ColorRGBA color, double strokeWidth = 1)
 {
     gx.Rectangle(rect.Left, rect.Bottom, rect.Right, rect.Top, color, strokeWidth);
 }
Exemple #12
0
 public static bool GetBoundingRect(VertexStore vxs, int[] gi,
                                    int num,
                                    out RectD boundingRect)
 {
     return(GetBoundingRect(vxs, gi, num, out boundingRect.Left, out boundingRect.Bottom, out boundingRect.Right, out boundingRect.Top));
 }
 public static void FillRectangle(this Graphics2D gx, RectD rect, Color fillColor)
 {
     gx.FillRectangle(rect.Left, rect.Bottom, rect.Right, rect.Top, fillColor);
 }
 public static void Rectangle(this Graphics2D gx, RectD rect, Color color, double strokeWidth = 1)
 {
     gx.Rectangle(rect.Left, rect.Bottom, rect.Right, rect.Top, color, strokeWidth);
 }
Exemple #15
0
 public void InvalidateBounds()
 {
     _needBoundUpdate = true;
     _boundRect       = new RectD(this.X, this.Y, 2, 2);
 }