示例#1
0
 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();
 }
示例#2
0
文件: Rectangle.cs 项目: ipzPZ121/OOP
        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;
        }
示例#3
0
文件: Rectangle.cs 项目: ipzPZ121/OOP
 public Rectangle(Rectangle rect)
 {
     X = rect.GetX();
     Y = rect.GetY();
     W = rect.GetW();
     H = rect.GetH();
 }