Пример #1
0
        bool _intersectWithX(Line2I nLine)
        {
            int x_ = default(int);
            int x0_ = default(int);
            int x1_ = mPoint._getX();
            int x2_ = mPoint._getX() + mSize._getWidth();
            if (((nLine._begX() < x1_) && (nLine._endX() > x1_)) || ((nLine._begX() > x1_) && (nLine._endX() < x1_)))
            {
                x_ = x1_;
            }

            if (((nLine._begX() < x2_) && (nLine._endX() > x2_)) || ((nLine._begX() > x2_) && (nLine._endX() < x2_)))
            {
                x0_ = x2_;
            }
            if ((x_ == default(int)) && (x0_ == default(int)))
            {
                return false;
            }
            int y1_ = mPoint._getY();
            int y2_ = mPoint._getY() + mSize._getHeight();

            int y_ = default(int);
            if (x_ != default(int))
            {
                y_ = nLine._yPoint(x_);
            }

            int y0_ = default(int);
            if (x0_ != default(int))
            {
                y0_ = nLine._yPoint(x0_);
            }

            if ((y_ > y1_) && (y_ < y2_))
            {
                return true;
            }

            if ((y0_ > y1_) && (y0_ < y2_))
            {
                return true;
            }
            return false;
        }