VixenModules.Preview.VixenPreview.Shapes.PreviewLine.MoveTo C# (CSharp) Method

MoveTo() public method

public MoveTo ( int x, int y ) : void
x int
y int
return void
        public override void MoveTo(int x, int y)
        {
            Point topLeft = new Point();
            topLeft.X = Math.Min(_points[0].X, _points[1].X);
            topLeft.Y = Math.Min(_points[0].Y, _points[1].Y);

            int deltaX = x - topLeft.X;
            int deltaY = y - topLeft.Y;

            _points[0].X += deltaX;
            _points[0].Y += deltaY;
            _points[1].X += deltaX;
            _points[1].Y += deltaY;

            Layout();
        }