Пример #1
0
        public static GridBoundingBox FromSize(int minX, int minY, int width, int height)
        {
            if (width < 1 || height < 1)
            {
                throw new ArgumentException("Size must be greater than 0");
            }
            var xInterval = GridInterval.FromExclusiveMax(minX, minX + width);
            var yInterval = GridInterval.FromExclusiveMax(minY, minY + height);

            return(new GridBoundingBox(xInterval, yInterval));
        }
Пример #2
0
        public static GridBoundingBox FromMinMaxExcl(int minX, int minY, int maxXExcl, int maxYExcl)
        {
            if (maxXExcl <= minX || maxYExcl <= minY)
            {
                throw new ArgumentException("Max is exclusive and must be greater than Min");
            }

            var xInterval = GridInterval.FromExclusiveMax(minX, maxXExcl);
            var yInterval = GridInterval.FromExclusiveMax(minY, maxYExcl);

            return(new GridBoundingBox(xInterval, yInterval));
        }