public FRectangle(FPoint location, FSize size) { X = location.X; Y = location.Y; Width = size.Width; Height = size.Height; }
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)); }
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; }
public FPoint ModuloToToSize(FSize bounds) { return(new FPoint(FloatMath.PositiveModulo(X, bounds.Width), FloatMath.PositiveModulo(Y, bounds.Height))); }
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)); }
public FRectangle AsResized(FSize size) { return(new FRectangle(X + Width / 2 - size.Width / 2, Y + Height / 2 - size.Height / 2, size.Width, size.Height)); }