protected override void DoDraw(PaintData data, int cell1, int cell2) { var p1 = data.Align(cell1, PaintData.AlignSide.Center); var p2 = data.Align(cell2, PaintData.AlignSide.Center); var pen = new Pen(Color.Red, 3f); data.Graphics.DrawLine(pen, p1.X, p1.Y, p2.X, p2.Y); }
protected override void DoDraw(PaintData data, int cell1, int cell2) { int x1 = Math.Min(cell1 % data.LayoutSize, cell2 % data.LayoutSize); int x2 = Math.Max(cell1 % data.LayoutSize, cell2 % data.LayoutSize); int y1 = Math.Min(cell1 / data.LayoutSize, cell2 / data.LayoutSize); int y2 = Math.Max(cell1 / data.LayoutSize, cell2 / data.LayoutSize); var p1 = data.Align(x1 + y1 * data.LayoutSize, PaintData.AlignSide.TopLeft); var p2 = data.Align(x2 + y2 * data.LayoutSize, PaintData.AlignSide.BottomRight); var pen = new Pen(Color.Red, 3f); data.Graphics.DrawEllipse(pen, p1.X, p1.Y, p2.X - p1.X, p2.Y - p1.Y); }