public override void Draw(int gridSize, Graphics g) { using (Pen pen = new Pen(new SolidBrush(Color), MeasurementWidth)) { g.DrawLine(pen, Start.ToPoint(gridSize), End.ToPoint(gridSize)); // figure out the angle double degrees = DrawFacts.ComputeSlopeInDegrees(Start, End); // we need to translate the ends at each of the points (start and end) DrawEndLine(gridSize, g, Start, degrees, pen); DrawEndLine(gridSize, g, End, degrees, pen); DrawRotatedMeasureText(gridSize, g, degrees); } }
public override bool ContainsPoint(int gridSize, Point p) { //check all 4 lines. return(DrawFacts.PointOnRectangle(TopLeft.ToPoint(gridSize), BottomRight.ToPoint(gridSize), p, Width)); }
public override bool ContainsPoint(int gridSize, Point p) { return(DrawFacts.PointOnLineSegment(Start.ToPoint(gridSize), End.ToPoint(gridSize), p, Width)); }
public override bool ContainsPoint(int gridSize, Point p) { return(DrawFacts.PointInsideRectangle(Start.ToPoint(gridSize), BottomRight.ToPoint(gridSize), p)); }