Ejemplo n.º 1
0
        public void MakeHold( Rectangle2D r )
        {
            if ( r.m_Start.m_X < m_Start.m_X )
                m_Start.m_X = r.m_Start.m_X;

            if ( r.m_Start.m_Y < m_Start.m_Y )
                m_Start.m_Y = r.m_Start.m_Y;

            if ( r.m_End.m_X > m_End.m_X )
                m_End.m_X = r.m_End.m_X;

            if ( r.m_End.m_Y > m_End.m_Y )
                m_End.m_Y = r.m_End.m_Y;
        }
Ejemplo n.º 2
0
        // "test" must be smaller than this rectangle!
        public bool Insersects( Rectangle2D test )
        {
            Point2D e1 = new Point2D( test.Start.X + test.Width, test.Start.Y );
            Point2D e2 = new Point2D( test.Start.X, test.Start.Y + test.Width );

            return Contains( test.Start ) || Contains( test.End ) || Contains( e1 ) || Contains( e2 );
        }