Example #1
0
 public override bool ContainsPoint(int gridSize, Point p)
 {
     //check all 4 lines.
     return(DrawFacts.PointOnRectangle(TopLeft.ToPoint(gridSize), BottomRight.ToPoint(gridSize), p, Width) ||
            DrawFacts.PointInsideRectangle(TopLeft.ToPoint(gridSize), BottomRight.ToPoint(gridSize), p));
 }
Example #2
0
 public override void Draw(int gridSize, Graphics g)
 {
     g.FillRectangle(new SolidBrush(Color), new System.Drawing.Rectangle(TopLeft.ToPoint(gridSize),
                                                                         new Size(Math.Abs((TopLeft.X - BottomRight.X) * gridSize), Math.Abs((TopLeft.Y - BottomRight.Y) * gridSize))));
 }