Beispiel #1
0
 public FRectangle(FPoint location, FSize size)
 {
     X      = location.X;
     Y      = location.Y;
     Width  = size.Width;
     Height = size.Height;
 }
Beispiel #2
0
 internal bool Contains(FPoint center, FSize size)
 {
     return
         (X <= (center.X + size.Width / 2) &&
          Y <= (center.Y + size.Height / 2) &&
          (X + Width) >= (center.X - size.Width / 2) &&
          (Y + Height) >= (center.Y - size.Height / 2));
 }
Beispiel #3
0
        public FRotatedRectangle(FPoint c, FSize s, float rot)
        {
            CenterX  = c.X;
            CenterY  = c.Y;
            Width    = s.Width;
            Height   = s.Height;
            Rotation = rot;

            _cacheMostLeft   = null;
            _cacheMostRight  = null;
            _cacheMostTop    = null;
            _cacheMostBottom = null;
        }
Beispiel #4
0
 public FPoint ModuloToToSize(FSize bounds)
 {
     return(new FPoint(FloatMath.PositiveModulo(X, bounds.Width), FloatMath.PositiveModulo(Y, bounds.Height)));
 }
Beispiel #5
0
 public static FRectangle CreateByCenter(FPoint pos, FSize size)
 {
     return(new FRectangle(pos.X - size.Width / 2, pos.Y - size.Height / 2, size.Width, size.Height));
 }
Beispiel #6
0
 public FRectangle AsResized(FSize size)
 {
     return(new FRectangle(X + Width / 2 - size.Width / 2, Y + Height / 2 - size.Height / 2, size.Width, size.Height));
 }