AddMaterials.View.Controls.FillPatternViewerControlWpf.LineIntersectsRect C# (CSharp) Method

LineIntersectsRect() public method

public LineIntersectsRect ( System p1, System p2, Rectangle r ) : bool
p1 System
p2 System
r System.Drawing.Rectangle
return bool
        public bool LineIntersectsRect( 
            System.Drawing.Point p1,
            System.Drawing.Point p2,
            Rectangle r)
        {
            return LineIntersectsLine( p1, p2, new System.Drawing.Point( r.X, r.Y ), new System.Drawing.Point( r.X + r.Width, r.Y ) )
            || LineIntersectsLine( p1, p2, new System.Drawing.Point( r.X + r.Width, r.Y ), new System.Drawing.Point( r.X + r.Width, r.Y + r.Height ) )
            || LineIntersectsLine( p1, p2, new System.Drawing.Point( r.X + r.Width, r.Y + r.Height ), new System.Drawing.Point( r.X, r.Y + r.Height ) )
            || LineIntersectsLine( p1, p2, new System.Drawing.Point( r.X, r.Y + r.Height ), new System.Drawing.Point( r.X, r.Y ) )
            || ( r.Contains( p1 ) && r.Contains( p2 ) );
        }

Same methods

FillPatternViewerControlWpf::LineIntersectsRect ( System.Drawing.Drawing2D.Matrix rayMatrix, Rectangle r ) : bool