示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        public virtual void OnDraw(PaintData paintData)
        {
            if (!IsButtonPressed)
            {
                return;
            }

            var mirrorCells1 = paintData.GetMirrorCells(StartPosition.CellIndex).ToArray();
            var mirrorCells2 = paintData.GetMirrorCells(CurrentPosition.CellIndex).ToArray();

            if (mirrorCells1.Length != mirrorCells2.Length)
            {
                throw new InvalidOperationException();
            }

            for (var i = 0; i < mirrorCells1.Length; ++i)
            {
                DoDraw(paintData, mirrorCells1[i], mirrorCells2[i]);
            }
        }
示例#4
0
 public void OnDraw(PaintData paintData)
 {
 }
示例#5
0
 protected abstract void DoDraw(PaintData data, int cell1, int cell2);