Esempio n. 1
0
 public Rectangle(Point topLeft, Dimensions size) : this(topLeft, size.Width, size.Height)
 {
 }
Esempio n. 2
0
 public bool Contains(Dimensions d) => Dimensions.Contains(d);
Esempio n. 3
0
        public static Rectangle CreateRandom(SimpleRandom random, Rectangle boundingRectangle, Dimensions minSize)
        {
            var width = (byte)random.Next(minSize.Width, boundingRectangle.Width + 1);
            var x1    = (byte)random.Next(boundingRectangle.TopLeft.X, boundingRectangle.BottomRight.X + 2 - width);

            var height = (byte)random.Next(minSize.Height, boundingRectangle.Height + 1);
            var y1     = (byte)random.Next(boundingRectangle.TopLeft.Y, boundingRectangle.BottomRight.Y + 2 - height);

            return(new Rectangle(new Point(x1, y1), width, height));
        }