Exemple #1
0
        static public void SplitByY(this RectI2 item, int y, out RectI2 bottom, out RectI2 top)
        {
            int split = y.Min(item.GetTop());

            bottom = RectI2Extensions.CreateStrictMinMaxRectI2(item.min, item.max.GetWithY(split));
            top    = RectI2Extensions.CreateStrictMinMaxRectI2(item.min.GetWithY(split), item.max);
        }
Exemple #2
0
        static public void SplitByX(this RectI2 item, int x, out RectI2 left, out RectI2 right)
        {
            int split = x.Min(item.GetRight());

            left  = RectI2Extensions.CreateStrictMinMaxRectI2(item.min, item.max.GetWithX(split));
            right = RectI2Extensions.CreateStrictMinMaxRectI2(item.min.GetWithX(split), item.max);
        }
Exemple #3
0
 static public RectI2 GetLeftSlice(this RectI2 item, int amount)
 {
     return(RectI2Extensions.CreateStrictMinMaxRectI2(
                item.GetLeft(),
                item.GetBottom(),
                (item.GetLeft() + amount).BindBelow(item.GetRight()),
                item.GetTop()
                ));
 }
Exemple #4
0
        static public RectI2 GetEncompassing(this RectI2 item, RectI2 rect)
        {
            return(RectI2Extensions.CreateStrictMinMaxRectI2(
                       item.GetLeft().Min(rect.GetLeft()),
                       item.GetBottom().Min(rect.GetBottom()),

                       item.GetRight().Max(rect.GetRight()),
                       item.GetTop().Max(rect.GetTop())
                       ));
        }