コード例 #1
0
        static public RectF2 GetConstrainedBelowX(this RectF2 item, float x)
        {
            if (item.GetRight() > x)
            {
                return(item.GetHorizontallyShifted(x - item.GetRight()));
            }

            return(item);
        }
コード例 #2
0
        static public RectF2 GetConstrainedAboveX(this RectF2 item, float x)
        {
            if (item.GetLeft() < x)
            {
                return(item.GetHorizontallyShifted(x - item.GetLeft()));
            }

            return(item);
        }