Example #1
0
        protected override void OnMove(Point p)
        {
            base.OnMove(p);

            if(Target != null && ColorHolder != null && Target.IsReady)
            {
                Target.UpdateDrawable();
                var points = new Dictionary<Point, Color>();
                GenericDraw.Line(BeginPoint, p.ToMap(Target.GridWidth), ColorHolder, points);
                Target.FakeDrawPixel(points.GetDistributionColor(Target, Width));
            }
        }
Example #2
0
        protected override bool OnEnd(Point p)
        {
            base.OnEnd(p);

            if (Target != null && ColorHolder != null && Target.IsReady)
            {
                var points = new Dictionary<Point, Color>();
                GenericDraw.Line(BeginPoint, p.ToMap(Target.GridWidth), ColorHolder, points);
                var command = new DrawPixelCommand()
                {
                    Points  = points.GetDistributionColor(Target, Width),
                    Target  = Target,
                };
                CommandManager.Instance.Do(command);

                Target.UpdateDrawable();
                return true;
            }
            return false;
        }