Esempio n. 1
0
 private void ReadColor(Point p)
 {
     if (Target != null && Target.IsReady)
     {
         ColorHolder = Target.ReadPixel(p.ToMap(Target.GridWidth));
     }
 }
Esempio n. 2
0
 protected override void OnMove(Point p)
 {
     base.OnMove(p);
     if (Target != null && Target.IsReady)
     {
         DrawPoints.Add(p.ToMap(Target.GridWidth));
     }
 }
Esempio n. 3
0
        protected override void OnBegin(Point p)
        {
            base.OnBegin(p);

            if(Target != null && Target.IsReady)
            {
                BeginPoint = p.ToMap(Target.GridWidth);
            }
        }
Esempio n. 4
0
 protected override bool OnEnd(Point p)
 {
     base.OnEnd(p);
     if (Target != null && Target.IsReady)
     {
         DrawPoints.Add(p.ToMap(Target.GridWidth));
     }
     return false;
 }
Esempio n. 5
0
        protected override void OnBegin(Point p)
        {
            base.OnBegin(p);

            if (Target.IsReady)
            {
                LastPoint = p.ToMap(Target.GridWidth);
                DrawPoints.Add(LastPoint);
            }
        }
Esempio n. 6
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));
            }
        }
Esempio n. 7
0
        protected override void OnMove(Point p)
        {
            base.OnMove(p);

            if (Target != null && Target.IsReady)
            {
                var old_last = LastPoint;
                LastPoint = p.ToMap(Target.GridWidth);

                GenericDraw.Line(old_last, LastPoint, Target.DefaultDrawColor, FakeDrawPoints);
                Target.FakeDrawPixel(FakeDrawPoints.GetDistributionColor(Target, Width));
            }
        }
Esempio n. 8
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;
        }
Esempio n. 9
0
        protected override bool OnEnd(Point p)
        {
            base.OnEnd(p);

            if (Target != null && ColorHolder != null && Target.IsReady)
            {
                var mapp    = p.ToMap(Target.GridWidth);
                var points  = GenericDraw.GetPointsWithSameColor(Target, mapp, Target.ReadPixel(mapp));

                var command = new DrawPixelCommand()
                {
                    Points  = points.Select(x => new KeyValuePair<Point, Color>(x.Key, ColorHolder)),
                    Target  = Target,
                };
                CommandManager.Instance.Do(command);

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