System.Windows.Rect.Union C# (CSharp) Method

Union() public static method

public static Union ( Rect rect, Point point ) : Rect
rect Rect
point Point
return Rect
        public static Rect Union(Rect rect, Point point)
        {
            rect.Union(new Rect(point, point));
            return rect;
        }

Same methods

Rect::Union ( Rect rect1, Rect rect2 ) : Rect
Rect::Union ( Point point ) : void
Rect::Union ( Rect rect ) : void

Usage Example

Example #1
0
 /// <summary>
 /// Sets the item's position according to its tikzitem's value
 /// </summary>
 public override bool AdjustPosition(double Resolution)
 {
     Rect r = new Rect(0, 0, 0, 0);
     bool hasone = false;
     foreach (OverlayShape o in children)
     {
         o.AdjustPosition(Resolution);
         Rect rr = o.View.GetBB();
         if (hasone)
             r.Union(rr);
         else
         {
             r = rr;
             hasone = true;
         }
     }
     if (hasone)
     {
         r.Inflate(20, 20);
         //r = new Rect(10, 10, 100, 100);
         View.SetSize( r.Width, r.Height);
         View.SetPosition(r.X, r.Y);
         return true;
     }
     else return false;
 }
All Usage Examples Of System.Windows.Rect::Union