public MyVectorArr(Rectangle rect) : this() { arr = new int[4]; arr[0] = rect.GetX(); arr[1] = rect.GetY(); arr[2] = rect.GetX() + rect.GetW(); arr[3] = rect.GetY() + rect.GetH(); }
public Rectangle Intersect(Rectangle rect) { Rectangle intersect = new Rectangle(); intersect.SetX(X > rect.GetX() ? X : rect.GetX()); intersect.SetY(Y > rect.GetY() ? Y : rect.GetY()); intersect.SetW(((W - rect.W) > 0) ? (W - rect.W) : ((W - rect.W) * -1)); intersect.SetH(((H - rect.H) > 0) ? (H - rect.H) : ((H - rect.H) * -1)); return intersect; }
public Rectangle(Rectangle rect) { X = rect.GetX(); Y = rect.GetY(); W = rect.GetW(); H = rect.GetH(); }